Not able to Count rows after filter is applied.

nav2567
nav2567 used Ask the Experts™
on
Hello,

I have an Excel spreadsheet that contains user information.  

One of the columns is called LASTLOGONTIME.  I apply a filter to filter that column only to only specific year and month.

After that, I highlight rows and trying to get the count of how many rows of users.  

The number in the Count field is not correct.  

Please see the attached and advise.  

Thanks.
user-info.png
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Rob HensonFinance Analyst
Commented:
You can use the SUBTOTAL function to show a count of the filtered rows:

=SUBTOTAL(3,A1:A90)

Enter the formula in a cell below the filter range and it will still be visible.

Your count in the status bar might actually be correct looking at your screenshot. You have selected the range and there are 5 rows visible but you have selected at least 7 columns with values, 7 x 5 = 35
Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015
Commented:
The Count figure is the count of the cells in the selected range not the count of the rows visible.
If you want to count the rows, you need to select cells in one of the column only.

When you filter the data set, if you notice on the left side of the status bar (just opposite to where the count figure appears i.e. next to the macro recorder button on the status bar), you will notice that Excel displays the filters rows details. That count will give you the exact count of the filtered rows.
Subodh Tiwari (Neeraj)Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015

Commented:
Here is what I am referring to...

Filtered-Rows.jpg
Rob HensonFinance Analyst

Commented:
To confirm that the figures on the right hand end of the status bar are correct for your selection.

Range selected is 5 rows and more than 7 columns. Only the first 7 columns contain values/text so Count shows 35.
Of those cells that contain numbers there are 20 (the 4 time columns).
The SUM of those is shown as 861955.0402 which when divided by 20 gives 43097.75201 which shows as your average value.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial