sumif with 'OR'

G

Guest

I would like to add up columns that meet 1 criteria from column 1 and that
also meet certain criteria from column B.

A B C
212 31A 20
304 31A 20
212 31B 20
212 31C 10
304 31B 20

For e.g. is there some way I can add up all the Amounts for 212 (from Column
A) that are either 31A or 31B (from column B) returning back an answer that
sums the relevant figures from column C?

If you have an answer, it will be much appreciated; I've beens scratching my
head with this one for a while!

Thanks,
Amanda
 
D

Dave Peterson

G

Guest

Try something like this:

Using your posted data list...
F2: 212
G2: 31A
G3: 31B

This formula returns the sum of Col_C items where the corresponding Col_A
value equals 212 AND the corresponding Col_B value equals 31A OR 31B
H2: =SUMPRODUCT((A2:A10=F2)*((B2:B10=G2)+(B2:B10=G3))*C2:C10)

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP
 
G

Guest

sumproduct() will work
= sumproduct(--(A1:A1000=212),--(or(B1:B1000="31A",B1:B1000="31B)),C1:C1000)
the "--(" changes the logical true false to a numeric 1 0
you cannot reference an entire column in Sumproduct (A:A wont work)
all of the arrays have to be the same size
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top