SUMIF function.... possible to pass 2 different "criter

rca

Board Regular
Joined
Mar 1, 2005
Messages
182
Hi Everyone,

Please help!!

Is it possible to pass two (2) separate "criteria" (the second argument) in the SUMIF function?

For example, I have the following in my worksheet:

- in B17:B28, I have some data
- in E17:C28, I have some other data
- in J17:D28, I have the numbers to be summed up


- I would like to use the SUMIF function to SUM up the range J17:J28 based on the criteria in range B:17:B28 and E17:E28. More to the point, the function would sum only if the criteria in B17:B28 and E17:E28 matched.

note: this gets tricky because you also have to pass these criteria through the "range" argument in the SUMIF function

Is this even possible?

If it's not possible using the SUMIF formula directly, can someone please suggest some VBA code that might do the trick??

Thank you!
Rachel :biggrin: :oops:
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
see if this works


=SUMPRODUCT(--(B17:B28=E17:E28),J17:J28)

if not post some of your data and your expected result



here's a quick example
Book1
ABCD
1aa10
2bb20
3cd30
4ee40
5
6
770
Sheet1
 
Upvote 0

Forum statistics

Threads
1,213,530
Messages
6,114,162
Members
448,554
Latest member
Gleisner2

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