SUMIF(AND(


Posted by Kate on February 16, 2001 10:03 AM

I have three columns of data. The first two contain
qualifying conditions, the third is the data I would
like to sum. Is there a way to sum this data in one
equation, based on the first two columns meeting a
set of conditions? e.g. if(and(A:A=1,B:B=2),sum(C:C)
Currently, I create a fourth column of data satisfying
the if(and(A1=1,B1=2) condition, then sum the column
in a separate formula.

Posted by Aladin Akyurek on February 16, 2001 10:31 AM

Do you really mean by SUM(C:C) summing everything in C with any combination of criteria in A and B?

Aladin

Posted by loren on February 16, 2001 10:32 AM

Re: SUMIF( 2 conditions

Posted by Kate on February 16, 2001 11:24 AM

Yes, I want to sum everything in column C that
meets the criteria in colunms A & B.

Posted by Aladin Akyurek on February 16, 2001 12:33 PM

: I have three columns of data. The first two contain : qualifying conditions, the third is the data I would : like to sum. Is there a way to sum this data in one : equation, based on the first two columns meeting a : set of conditions? e.g. if(and(A:A=1,B:B=2),sum(C:C) : Currently, I create a fourth column of data satisfying : the if(and(A1=1,B1=2) condition, then sum the column : in a separate formula.

Then, array-enter (d.i., hit control+shift+enter to enter) in

D1 =SUM((A1=1)*(B1=2)*($C$1:$C$3))

You can't alas use a range like C:C in the above formula. So you have to specify the range to sum to which the formula must apply.

If both a1=1 or b1=2 hold, you'll get the sum of the values in C, otherwise 0. In order to have another set of conditions, you have to copy down the formula and adjust the first two terms in the formula.

Kate, I still doubt whether this is what you want, partly because I fail to imagine your situation.
You can send me a snippet of your data if you want to.

Aladin

Posted by Scott R on February 16, 2001 1:32 PM

I have three columns of data. The first two contain

Try this:
=SUM(IF((A1:A10=D1)*(B1:B10=E1),C1:C10))
where your data is in A1:B10 and your criteria for A & B are in D1 & E1 respectively.
Enter as an array, ctrl+shift+enter.
I couldn't get it to work w/complete columns, ie. A:A.

A 3rd column could also be evaluated, etc:
=SUM(IF((A1:A10=E1)*(B1:B10=F1)*(C1:C10=G1),D1:D10))



Posted by Dave Hawley on February 17, 2001 3:10 AM

I have three columns of data. The first two contain

Hi Kate

Here is another way using an Array formula. Enter with Ctrl+Shift+Enter

=SUM(IF(A1:A60000=1,IF(B1:B60000=2,C1:C60000)))


You could also use the DSUM for this (which is more efficient).

Put a heading for column A, B . Now copy these to D1:E1. under D1 put: 1 Under E1 put 2. In any cell put this;

=DSUM(A:C,C1,D1:E2)

I have some examples and important rules regarding Array formulas on my web site if you are interested.

DaveOzGrid Business Applications