Count If for Filtered cells

howerd

New Member
Joined
Dec 24, 2009
Messages
44
Hi,

I was wondering if someone can help me on a formula I am trying to use.

I am trying to incorporate a countif formula, which only counts cells which have showing when the filter is applied. I have the following formula which appears to work:

=SUMPRODUCT(SUBTOTAL(3,OFFSET($AB$3:$AB$500,ROW($AB$3:$AB$500)-ROW($AB$3),0,1)),--($AB$3:$AB$500=B4))

Where I am struggling is when I try to 'count' cells which have data between two figures, for example greater than or equal to 6 and less than or equal to 10. I have tried the following formula

=SUMPRODUCT(SUBTOTAL(3,OFFSET($G$3:$G$500,ROW($G$3:$G$500)-ROW($G$3),0,1)),--(($G$3:$G$500>=6)*AND(G3:$G$500<=10)))

This appears to work when the figures are below 10, however if one of the cells goes above 10, it shows a count of 0?

I am sure it is a simple error, but any help would be greatly appreciated.

Thanks.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
without AND
=SUMPRODUCT(SUBTOTAL(3,OFFSET($G$3:$G$500,ROW($G$3:$G$500)-ROW($G$3),0,1)),--(($G$3:$G$500>=6)*(G3:$G$500<=10)))
 
Upvote 0
Hi Andrew / Yahya,

That's a great help, thank you very much! (new it would be something simple!)

Cheers

Chris
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,712
Members
452,939
Latest member
WCrawford

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