Conditional Sum

August 18th, 2004 | Categories: SUMIF | Tags:

So you want to sum a range based on a condition eh? For instance you want to sum the total for just one person in a range of names? Like this picture sums the range A2:A10 on the condition the cell equals “Mark”, and does this in cell D3: The easiest way is with Sumif, but here’s another just for fun.

ConditionalSum

The syntax to do this:

=Sum(If(RangeWithCondition=”condition”,RangeToGetSum,0))

And hit Control, Shift and Enter to make it an array formula, it won’t work without doing this. (this adds the Braces {} around your formula)


The play by play

In a cell you want a conditional sum:

1. Type =Sum(If(
2. Click and Drag the Range with the condition, in this example I click and dragged A2 to A10, this automatically filled my formula
3. Type equals (=)
4. In quotation marks type the condition you want to test for, in this example I typed “Mark”, because I want to sum if this condition is true
5. Type comma (,)

Now if it finds the specified range has a condition equal to “Mark”, we need to tell it where to get the numbers to sum.

6. Click and Drag the Range with the numbers to sum if the condition is true
7. Type ,0)) (this will display zero if nothing is found and closes the formula)
8. And most importantly, hit Control, Shift and Enter to make it an array formula

  1. August 13th, 2009 at 08:24
    Reply | Quote | #1

    I always used filtering fot that perpuse seems your suggestion is better