How to sum visible cells only
Tutor 5 (55 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To sum visible cells only in Excel, use the SUBTOTAL or AGGREGATE functions. These functions ignore hidden rows caused by filters or manual hiding, unlike the standard SUM function.
Using SUBTOTAL
-
Select the cell where you want the result.
-
Enter the formula:
=SUBTOTAL(109, A1:A20)
Explanation:
-
109is the function number for SUM that ignores hidden rows. -
A1:A20is the range you want to sum.
-
-
Press Enter. Excel will sum only the cells that are visible.
Notes:
-
If you manually hide rows,
SUBTOTALwill skip them when using109. -
Using
9instead of109will sum all cells, including hidden ones.
Using AGGREGATE
-
Select the cell for the result.
-
Enter the formula:
=AGGREGATE(9, 5, A1:A20)
Explanation:
-
9is the function number for SUM. -
5is the option to ignore hidden rows and error values. -
A1:A20is the range to sum.
-
-
Press Enter. This method works for both filtered data and hidden rows.
Key Differences Between SUBTOTAL and AGGREGATE
-
SUBTOTAL ignores hidden rows with specific function numbers (100+), but it cannot ignore errors unless combined with additional formulas.
-
AGGREGATE is more flexible: it can ignore hidden rows, errors, and nested SUBTOTAL/AGGREGATE functions.
Example
Suppose column B contains sales amounts from B2:B10. Some rows are filtered out.
-
Using
=SUBTOTAL(109, B2:B10)will sum only visible sales. -
Using
=AGGREGATE(9, 5, B2:B10)will give the same result, skipping hidden rows.
This ensures your totals reflect only the data currently visible, maintaining accuracy when filtering or hiding rows.
. 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 is today function not working
Answers · 1
How to extract date from datetime in excel
Answers · 1
Why is the date value not working
Answers · 1
How to create a date formula
Answers · 1