Thread: sumif with 'OR'
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default sumif with 'OR'

One way:

=SUMPRODUCT(--(A1:A10=212),--(((B1:B10="31a")+(B1:B10="31b"))0),C1:C10)

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html



A Heeps wrote:

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


--

Dave Peterson