How to sum filtered cells in excel
Tutor 5 (37 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
Summing filtered cells in Excel means calculating the total of only the visible rows after applying a filter. Excel excludes hidden or filtered-out rows when the correct function is used. To sum filtered cells in Excel, use the SUBTOTAL function because Excel designed it to ignore hidden or filtered-out rows.
Using SUBTOTAL with filtered data
-
Select the cell where the sum will appear.
-
Enter the formula:
Function number 9 calculates the sum and ignores filtered rows. -
Press Enter.
Using AutoSum with filtered data
-
Select the cell under the column you want to total.
-
Select Home → AutoSum.
-
Excel inserts a SUBTOTAL formula automatically.
-
Press Enter.
Windows and Mac differences
Excel uses the same SUBTOTAL function on both platforms. The ribbon paths are identical on Windows and Mac for AutoSum and for entering manual formulas.
How to sum only visible cells when rows are manually hidden
Excel interprets manually hidden rows differently from filtered rows. The AGGREGATE function helps when you want to ignore manually hidden rows.
Using AGGREGATE
-
Select the cell for the total.
-
Enter the formula:
Option 5 ignores manually hidden rows and errors. -
Press Enter.
How to sum only visible cells in a filtered table
Excel Tables provide structured references that update automatically when the table grows.
Using SUBTOTAL inside a Table
-
Convert the range to a Table:
Select the range → Insert → Table. -
Add a total row:
Table Design → Total Row. -
Excel creates a SUBTOTAL for the selected column and updates it as you filter.
Common issues and solutions
Why is my total including hidden rows?
The total includes hidden rows because the SUM function counts every value in the range. SUM never ignores hidden rows.
Why is SUBTOTAL giving the wrong number?
-
SUBTOTAL uses visible cells only with function number 9.
-
SUBTOTAL includes manually hidden rows unless you use AGGREGATE or hide rows with a filter.
Why is AGGREGATE not working correctly?
The wrong option number is used. Option 5 ignores hidden rows. Option 3 ignores hidden rows and nested SUBTOTAL or AGGREGATE functions.
Best practices for accurate totals
-
Use filters instead of manual hiding when possible.
-
Use SUBTOTAL in tables for dynamic ranges.
-
Use AGGREGATE when the dataset mixes filtered rows and manually hidden rows.
-
Place totals outside the filtered range so the formula always remains visible.
-
Maintain consistent column data types to prevent calculation errors.
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