SUBTOTAL with SUM IFs?

jeffe

New Member
Joined
Jul 16, 2009
Messages
9
I am having trouble getting the SUBTOTAL function to work with a SUM IF statement.

I would like to get a count of each cell that is greater than 14 but less than 21. Here’s what I have been using

{=SUM(IF(A$1:A$1000>14,IF(A$1:A$1000<21,1,0),0))}​

However, I would like to only count cells after certain filters have been applied, but I’m getting lost in the talk about SUMPRODUCT, OFFSET, among other functions I have seen on forums to make this work.

Would you be able to explain how I get this to work?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I am having trouble getting the SUBTOTAL function to work with a SUM IF statement.

I would like to get a count of each cell that is greater than 14 but less than 21. Here’s what I have been using
{=SUM(IF(A$1:A$1000>14,IF(A$1:A$1000<21,1,0),0))}
However, I would like to only count cells after certain filters have been applied, but I’m getting lost in the talk about SUMPRODUCT, OFFSET, among other functions I have seen on forums to make this work.

Would you be able to explain how I get this to work?
Try this...

=SUMPRODUCT(SUBTOTAL(2,OFFSET(A1:A1000,ROW(A1:A1000)-ROW(A1),0,1)),--(A1:A1000>14),--(A1:A1000<21))
 
Upvote 0
Thank you. I'm not fully sure how that worked, but it did. I'll have to look at that some more.

Thank you!!
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,293
Members
452,902
Latest member
Knuddeluff

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