Sum Values While Ignoring Errors
Total the valid numbers in an error-containing range with AGGREGATE, while keeping the ignored exceptions visible through a row-level IFERROR audit and explicit error count.
| Sum and Ignore Errors, Formula Review | |||||||||
| Compare ordinary SUM with two deliberate error-tolerant approaches. | |||||||||
| Source values | Approach comparison | ||||||||
| Item | Source value | Approach | Formula syntax | Result | |||||
| Item 1 | 20.0 | Standard SUM | =SUM(B12:B18) | #N/A | |||||
| Item 2 | 21.0 | SUMIF excludes #N/A only | =SUMIF(B12:B18,"<>#N/A") | #DIV/0! | |||||
| Missing lookup | #N/A | AGGREGATE ignores all errors | =AGGREGATE(9,6,B12:B18) | 152.5 | |||||
| Item 4 | 39.0 | SUM of IFERROR helper values | =SUM(IFERROR(B12:B18,0)) | 152.5 | |||||
| Invalid ratio | #DIV/0! | ||||||||
| Item 6 | 28.5 | ||||||||
| Item 7 | 44.0 | ||||||||
| Interpretation | |||||||||
| AGGREGATE with function number 9 and option 6 ignores both #N/A and #DIV/0! errors. A visible error count is still required because an available-data total does not resolve the underlying exceptions. | |||||||||
Overview
Return the total of valid numeric cells even when the same source range contains calculation errors. AGGREGATE keeps the available-data total operating, while an audit column and error count make every ignored exception visible rather than presenting it as resolved.
When to use it
Use it for interim totals from partially complete imports, controls that must remain available while lookup issues are investigated, or reporting where a usable subtotal and the unresolved exception count must be shown together.
When not to use it
Use ordinary SUM when the calculation should fail until every source error is corrected. Use only a row-level IFERROR helper when maximum transparency matters more than compactness. Do not ignore errors when missing values would make the available-data total misleading for the decision.
Problem
SUM propagates an error from any cell in its range, preventing a subtotal of otherwise valid observations. Simply suppressing errors can conceal source-data problems. The calculation must separate the available numeric total from the status of the ignored records.
Source data
The synthetic source in Combined Example!B12:B22 contains eleven rows:
Source values | Status |
|---|---|
20, 21, 10, 39 | Included |
| Ignored error |
28.5, 5.5, 12.5, 10, 6 | Included |
| Ignored error |
The nine numeric values total 152.5. Text and blanks do not contribute. Errors are intentional teaching cases; they are not claimed to be corrected.
Calculations
- Select function number 9 so AGGREGATE performs a sum.
- Select option 6 so error values are ignored.
- Apply the calculation to the bounded source range.
- Convert errors to zero in a separate IFERROR audit column.
- Label each row as included or ignored and count exceptions.
- Reconcile the compact total to the helper-column sum.
Outputs
AGGREGATE returns 152.5, and the IFERROR audit also returns 152.5. The workbook reports 2 ignored errors. Its ordinary SUM deliberately returns an error, showing why the alternate calculation is used.
Formula map
Available-data total
=AGGREGATE(9,6,B12:B22)
Row-level audit amount
=IFERROR(B12,0)
Exception status
=IF(ISERROR(B12),"Ignored error","Included")
Fill the two helper formulas down. Option 6 ignores errors but does not exclude hidden rows.
Model checks
The workbook checks that AGGREGATE equals the sum of the audit column and that exactly two deliberate source errors remain visible. Both tests return OK.
Edge cases
- With no errors, SUM and AGGREGATE return the same total.
- Option 6 ignores both demonstrated error types.
- Text and blanks do not add to the numeric result.
- Hidden rows remain included under option 6.
- If every cell is erroneous or nonnumeric, the returned total requires careful interpretation.
- A valid subtotal does not prove that the source data is complete.
Common errors
- Hiding the exception count: readers assume the data is clean. Show the ignored rows and count beside the total.
- Using a workaround for only one error type: another error still breaks the calculation. Use the documented AGGREGATE option or fix the source.
- Calling the result complete: ignored records may be material. Label it as an available-data total.
Example
Adding the nine valid values gives 20 + 21 + 10 + 39 + 28.5 + 5.5 + 12.5 + 10 + 6 = 152.5. AGGREGATE returns the same figure while excluding #N/A and #DIV/0!; the two audit statuses independently confirm what was omitted.
Example workbook
Edit the cream values in Combined Example!B12:B22. The source errors are deliberate. Available-data total, helper total, and error count appear in J13:J15; row statuses and two checks update automatically. Formula Review compares SUM, SUMIF, AGGREGATE, and IFERROR approaches.
Key takeaway
Keep an error-tolerant total available only alongside a visible exception count and audit trail, so ignored source problems cannot be mistaken for resolved data.