Sumif with two criteria

P

Paul Corrado

Dan,

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

Change the range references and criteria as needed.

PC
 
M

Mark Tymes

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
 
A

Alan Beban

But they can here:

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

Alan Beban
 
M

Mark Tymes

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
 
A

Alan Beban

I posted the following in this thread yesterday:

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

Alan Beban
 

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