• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 34
  • Last Modified:

Not able to Count rows after filter is applied.


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.  

  • 2
  • 2
2 Solutions
Rob HensonFinance AnalystCommented:
You can use the SUBTOTAL function to show a count of the filtered rows:


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
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
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 ExpertCommented:
Here is what I am referring to...

Rob HensonFinance AnalystCommented:
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.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now