# Sumif with mutiple criteria

#### Wa_Wa

##### Board Regular
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...

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")

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?

never mind - I grew a brain and realsed I didn't copy the formula fully - thanks again for all your help

Replies
6
Views
94
Replies
9
Views
144
Replies
5
Views
358
Replies
4
Views
334
Replies
4
Views
154

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

### 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