Cleanest Way to Use Sumif adding multiple critera?

MikeWeaver

New Member
Joined
Jul 23, 2014
Messages
26
I am looking for the cleanest way to sum everything in one column of a worksheet that meets the criteria for "Revenue" , or "Expense", my revenue column could actually have 10 or 12 line items so I am looking for the cleanest and shortest formula to do this. Thanks so much for any help you can give!

I have my table like this (simplified example):
[TABLE="width: 500"]
<tbody>[TR]
[TD]Class[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Total[/TD]
[/TR]
[TR]
[TD]Revenue[/TD]
[TD]Shoe Sales[/TD]
[TD]Other Revenue[/TD]
[TD]Sock Sales[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Expenses[/TD]
[TD]Blah[/TD]
[TD]Blah Blah[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


and financials like this (simplified example):[TABLE="width: 500"]
<tbody>[TR]
[TD]Shoe Sales[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]Other Revenue[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Operating Expense[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Sock Sales[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]Blah[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]Blah Blah[/TD]
[TD]10[/TD]
[/TR]
</tbody>[/TABLE]
 
Oh, Ok.

Then for Revenue it would be
=SUM(SUMIF(A1:A100,{"Sock Sales","Shoe Sales","Other Revenue"},B1:B100))

and for Expenses
=SUM(SUMIF(A1:A100,{"Expenses","Blah","Blah Blah"},B1:B100))

To use a Range for the criteria, say E2:G2
Try
=SUMPRODUCT(SUMIF(A1:A100,E2:G2,B1:B100))

That works perfectly. Thank you. I'm naming my first child Jonmo1.
 
Upvote 0

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