One #N/A and a plain SUM returns an error too. AGGREGATE totals a range while skipping errors (and optionally hidden rows) — no cleanup needed.
The example
A column with a stray error still totals.
| A | B | |
|---|---|---|
| 1 | Value | |
| 2 | 100 | |
| 3 | #N/A | |
| 4 | 50 | |
| 5 | AGGREGATE sum | 150 |
The formula
SUM that skips errors:
How it works
AGGREGATE is SUM/AVERAGE with skip options:
- The first argument picks the function: 9 = SUM, 1 = AVERAGE, 4 = MAX, etc.
- The second sets what to ignore: 6 = errors, 5 = hidden rows, 7 = both.
- The third is the range. Errors no longer poison the total.
- Older Excel (or a simpler need):
=SUMIF(B2:B100, "<>#N/A")works for a specific error, or wrap each cell’s formula in IFERROR upstream.
Ignore hidden rows too: option 7 skips both errors and rows hidden by a filter — handy for totals that should reflect only what’s visible. AGGREGATE needs Excel 2010+.
Try it: interactive demo
Values (use “err” for an error).
Variations
Ignore errors + hidden
Option 7:
Average ignoring errors
Function 1:
SUMIF alternative
Skip a known error:
Pitfalls & errors
2010 or later. AGGREGATE isn’t in Excel 2007.
Know the option codes. 6 = errors, 5 = hidden rows, 7 = both. The wrong code includes what you meant to skip.
Better to fix upstream. If you can, wrap source formulas in IFERROR so the data is clean — AGGREGATE is the patch when you can’t.
Practice workbook
Frequently asked questions
How do I sum a range that has errors in Excel?
How do I also ignore hidden rows?
What if I have an older Excel?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class