Combining SUMIF and SUBTOTAL formula

MrKaliszan

New Member
Joined
Mar 2, 2022
Messages
4
Office Version
  1. 365
Platform
  1. MacOS
Hi,

I have a problem combining a SUMIF and SUBTOTAL formula into one formula, so i only get the "shown" filtered rows summed when criteria is met. I hope you can help?


=SUMIF($D$5:D25;”Small";E5:E25)

=SUBTOTAL(9;E5:E25)



$D$5:D25 - is the range to look for the word “Small”

“Small” - is the criteria for which to SUM

E5:E25 - Is the range to sum If criteria is met



However I also have a filter in column B to filter the shown rows in E5:E25 and only want to sum the shown rows meeting the criteria “small” in Column D.


The formula is typed into cell E28
In E29 I have a similar formula looking for “Medium”
And in E30 I have one looking for “Large”
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
How about using a helper column with
Excel Formula:
=SUBTOTAL(3,D5)
then you can use
Excel Formula:
=SUMIFS(E5:E25;$D$5:D25;”Small";F5:F25;1)
change the F5:F25 to the column with the subtotal formula
 
Upvote 0
Solution
How about using a helper column with
Excel Formula:
=SUBTOTAL(3,D5)
then you can use
Excel Formula:
=SUMIFS(E5:E25;$D$5:D25;”Small";F5:F25;1)
change the F5:F25 to the column with the subtotal formula
As i can tell, this has too many arguments for a SUMIF... And in your answer you changed the sum range to the "look-up range" which i don't understand why.

Is it possible to use a SUMPRODUCT for this?

EDIT: the "range" to look up "small" is static so =SUMIF($D$5:$D$25;”Small";E5:E25)
 
Upvote 0
As i can tell, this has too many arguments for a SUMIF
I did not use sumif, I used sumifs plural
the "range" to look up "small" is static so =SUMIF($D$5:$D$25;”Small";E5:E25)
I just used the range in the formula you posted.

Is it possible to use a SUMPRODUCT for this?
Not without making it slow, volatile & complex.
The solution I suggested is far more efficient & also simpler. Why not try it, rather than just dismissing out of hand?
 
Upvote 0
I did not use sumif, I used sumifs plural

I just used the range in the formula you posted.


Not without making it slow, volatile & complex.
The solution I suggested is far more efficient & also simpler. Why not try it, rather than just dismissing out of hand?
Ah i'm sorry. My mistake. Tried it with with SUMIF... and failed obviously. Thanks for your help. Was not trying to sound unthankful, my apologies if i came across like that. My bad.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

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