Countif for Visible Rows Only

MikeDBMan

Well-known Member
Joined
Nov 10, 2010
Messages
610
I wish to count rows only of they are visible rows. Is there an existing function for doing so?

In other words, let's say I have a table that has a column Q1,Q2, Q3, Q4 for the financial period, Quarter 1, Quarter 2, etc. I wish to count how many entries exist in the table For Q1 that are visible rows. So if a row is filtered out or hidden it would NOT be counted. Thanks for your help!
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I wish to count rows only of they are visible rows. Is there an existing function for doing so?

In other words, let's say I have a table that has a column Q1,Q2, Q3, Q4 for the financial period, Quarter 1, Quarter 2, etc. I wish to count how many entries exist in the table For Q1 that are visible rows. So if a row is filtered out or hidden it would NOT be counted. Thanks for your help!
This formula will count only the filtered visible cells in the range A5:A20 that actually contain some entry:

=SUBTOTAL(3,A5:A20)
 
Upvote 0
You reply is not exactly my problem I don't think. I only want to count how many visible cells in a column have Q4 in them. So I need to do a qualified Countif. I want to know how many visible rows have Q4 in them.
 
Upvote 0
You reply is not exactly my problem I don't think. I only want to count how many visible cells in a column have Q4 in them. So I need to do a qualified Countif. I want to know how many visible rows have Q4 in them.
Ok, this will perform a "count if" on a filtered range.

Count only the visible cells that contain Q4.

=SUMPRODUCT(SUBTOTAL(3,OFFSET(A5:A20,ROW(A5:A20)-ROW(A5),0,1)),--(A5:A20="Q4"))
 
Upvote 0

Forum statistics

Threads
1,224,605
Messages
6,179,860
Members
452,948
Latest member
UsmanAli786

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