Formula to sum multiple criteria and multiple

Mr Spreadie

New Member
Joined
Oct 28, 2015
Messages
2
Hi all,

I'm curious to see if anyone's got any bright ideas about how to simply a sum formula I've created. I'm trying to sum figures in the range of columns O:R on a WS named 'Daily', where the only rows considered are text values from the range B6:B12 that are also in column D on the Daily WS. I've manged to make it work using the following formula:

=SUMPRODUCT(SUMIF(Daily!B:B,S6:S12,Daily!O:O)+SUMIF(Daily!B:B,S6:S12,Daily!P:P)+SUMIF(Daily!B:B,S6:S12,Daily!Q:Q)+SUMIF(Daily!B:B,S6:S12,Daily!R:R))

I was hoping to simply it and attempted the following:

=SUMPRODUCT(SUMIF(Daily!B:B,S6:S12,Daily!O:R))

However, the above SUMPRODUCT function only allows the critera (S6:S12) to become a range but not the sum range (Daily!O:R) too.

Any bright spark have any clues how to get the simplified version working?

Thanks in advance!
 
Like this?


Excel 2010
BCDEFGHIJKLMNOPQR
6Q33623633
7W61588343
8E9447426
9R48357183
10T4336369
11Y5726642
12U8306468
13
14
15E
16U
17Y
18526
Sheet13
Cell Formulas
RangeFormula
C18=SUMPRODUCT(COUNTIF($B$15:$B$17,$B$6:$B$12)*$O$6:$R$12)
 
Upvote 0
Thank you for your reply.

That worked to an extent where I specified an exact range in all instances. However the data in the table will change daily where I could encounter X number of rows. Therefore, to alter your example slightly, I would need something like:

(moving the criteria to column U)


=SUMPRODUCT(COUNTIF($U$15:$U$17,$B:$B)*$O:$R)


Because the above contains ranges that include blank cells then I receive a #VALUE! result.

Any thoughts on how to correct this?
 
Upvote 0
It worked when I tried:


Excel 2010
BCDEFGHIJKLMNOPQRSTU
6Q33623633
7W61588343
8E94476
9R48357183
10T4336369
11Y576642
12U8306468
13
14
15R
16U
17Y
18572
Sheet14
Cell Formulas
RangeFormula
C18=SUMPRODUCT(COUNTIF($U$15:$U$17,B:B)*O:R)


but is very slow because you're including all the rows. An index formula that counts would be much better for such a variable range.
 
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