Tutor 5 (54 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To count filtered cells in Excel, you must use functions that ignore hidden rows caused by filters. Standard counting functions like COUNT or COUNTA count all cells, including hidden ones.
Method 1: Using the SUBTOTAL Function
The SUBTOTAL function is designed to perform calculations on visible cells only.
-
Select the cell where you want the count to appear.
-
Enter the formula:
=SUBTOTAL(103, range)
-
103is the function number for counting non-empty visible cells. -
rangeis the range of cells you want to count, e.g.,A2:A100.
Example:
If column A contains 50 names and a filter hides 20 rows,
=SUBTOTAL(103, A2:A51)
will return 30, counting only the visible names.
Function Numbers for SUBTOTAL
-
102→ Counts numeric values in visible cells -
103→ Counts non-empty cells in visible cells
Method 2: Counting Only Filtered Numbers
If the column contains numbers, use:
=SUBTOTAL(102, B2:B100)
This counts only the visible numeric values after a filter.
Method 3: Using AGGREGATE Function
The AGGREGATE function can count filtered cells with more flexibility than SUBTOTAL.
-
Select the target cell.
-
Enter the formula:
=AGGREGATE(3, 5, range)
-
3→ COUNTA -
5→ Ignore hidden rows and errors -
range→ Range of cells to count
Example:
For column C, after filtering,
=AGGREGATE(3, 5, C2:C100)
returns the count of visible, non-empty cells.
Notes on Windows vs Mac
-
Both
SUBTOTALandAGGREGATEwork the same on Windows and Mac. -
Shortcut keys to open the function dialog may differ:
-
Windows:
Shift + F3 -
Mac:
Fn + Shift + F3
-
Tips
-
Use
SUBTOTALfor simplicity and fast results. -
Use
AGGREGATEwhen you need to handle errors in filtered ranges. -
Always check the filter to ensure only intended rows are counted.
This approach ensures accurate counts for filtered data without manual adjustments.
. Was this Helpful?Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
Why are margins not working
Answers · 1
Why is page layout not working
Answers · 1
How to print repeated rows on top in excel
Answers · 1
How to print header on each page
Answers · 1