Sumif with mutiple criteria

Wa_Wa

Board Regular
Joined
Jan 19, 2007
Messages
61
Hi,
Do you know if it is possible to sumif with mutiple criteria?

Name ---- Car ----- Cost
Bob ---- Car 1 ----- 1000
Bob ---- Car 1 ----- 1000
Bob ---- Car 2 ----- 1000
Bob ---- Car 3 ----- 1000

In the above example I want to be able to count the sum when name and car equal.

For example
Bob + car 1 = 2000
Bob + car 2 = 1000
Bob + car 3 = 1000
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
You could use a pivot table to do this.


One formula approach would be like this:
Code:
=SUMPRODUCT(--(A2:A5="Bob"),--(B2:B5="Car 1"),C2:C5)

In Excel 2007 you could use SUMIFS instead of SUMPRODUCT().

Hope that helps...
 
Upvote 0
Thanks very much - how ever if I want to drag the formula for the full dataset how would I enter this? (ie not hardcode "Bob" or "Car 1")
 
Upvote 0
I still recommend you use a pivot table which very simply produces the result you want.


Say you put Bob in cell E1, and you put Car 1 in F1, then the formula becomes:
Code:
=SUMPRODUCT(--(A2:A5=E1),--(B2:B5=F1),C2:C5)

Is that what you're looking for?
 
Upvote 0
never mind - I grew a brain and realsed I didn't copy the formula fully - thanks again for all your help
 
Upvote 0

Forum statistics

Threads
1,202,901
Messages
6,052,441
Members
444,581
Latest member
naninamu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top