View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default sumproduct or countif

So, the criteria is: O20:O79 = A *OR* B

Try one of these:

=SUMPRODUCT((O20:O79={"a","b"})*Q20:Q79)

=SUM(SUMIF(O20:O79,{"a","b"},Q20:Q79))

--
Biff
Microsoft Excel MVP


"freebee" wrote in message
...
Hi, I need to sum numbers in one column based on 2 critarias from another
column, I have formula as
=SUMPRODUCT(--($O$20:$O$79="a"),--($O$20:$O$79="b"),$Q$20:$Q$79)
but the result showed 0.
Am I correct for using sumproduct or shall I use countif (which I haven't
learned yet)?
Thank you.