Sumif with two criteria

  • Thread starter Thread starter Dan Perez
  • Start date Start date
Dan,

=SUMPRODUCT((A1:A10="x")*(B1:B10="y")*(C1:C10))

Change the range references and criteria as needed.

PC
 
Paul Corrado wrote
=SUMPRODUCT((A1:A10="x")*(B1:B10="y")*(C1:C10))
Change the range references and criteria as needed.

Very good solution. One little problem I have found with this in the past.
Suppose B1:B10 contains text like as illustrated below.

boat club
banana boat
fishing boat
sailing boat

What we want to do is sum the cells containing "boat" using the same
formula. B1:B10="boat" or even B1:B10="*boat*" did not work for me.

Mark
 
But they can here:

=SUMPRODUCT((A$1:A$5="x")*(SEARCH("*boat",B1:B5)*(C1:C5)))

Alan Beban
 
jr wrote
yes, the function description mentions this explicitly.
Wildcards cannot be used here.

I was unaware of this but I do believe it must be true. Thank you.

Mark
 
I posted the following in this thread yesterday:

=SUMPRODUCT((A$1:A$5="x")*(SEARCH("*boat",B1:B5)*(C1:C5)))

Alan Beban
 
Back
Top