• sumif with cell value as criterion (2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » sumif with cell value as criterion (2003)

    • This topic has 3 replies, 3 voices, and was last updated 18 years ago.
    Author
    Topic
    #442341

    A formula like
    =SUMIF(savings,”<=1000",savings)
    works ok.
    However, =SUMIF(savings,"<=B41",savings) doesn't.
    Nor does =SUMIF(savings,"<=(value(b41))",savings)
    What's the syntax to generate what I'm after, please?

    Viewing 0 reply threads
    Author
    Replies
    • #1064521

      Hi John

      Try

      =SUMIF(savings,”=”&B41)

      • #1064522

        Yep, that does the trick, Jezza.
        Should I have known this?
        How?
        With the equivalent COUNTIF formula, like this
        =COUNTIF(savings,”<="&B41),
        Excel puts the quotes and ampersand in itself, when the formula is constructed in the build-a-formula dialogue box.
        Thanks again

        • #1064533

          It’s important to keep in mind that the second argument of SUMIF and COUNTIF – the condition – is a text string that is interpreted literally. If you use

          =COUNTIF(savings,"<=B41")

          Excel will compare the value if each cell in the savings range to the text string B41, and count it if the value is the same or before it in dictionary order. If you use

          =COUNTIF(savings,"<="&B41)

          Excel will first evaluate the expression “<="&B41. Say that B41 contains the value 37, then the expression evaluates to "<=37". So Excel will compare the value if each cell in the savings range to 37, and count it if the value is less than or equal to 37.

    Viewing 0 reply threads
    Reply To: sumif with cell value as criterion (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: