SUM Ignoring Errors in Excel: How to Total Anyway
In this article
The quickest way to sum a range while ignoring errors is =SUM(IFERROR(A1:A20,0)). In Excel for Microsoft 365, Excel 2021 and later on Windows or Mac, that single formula spills and totals every number while treating any error cell as zero. If you are on an older version without dynamic arrays, wrap it the same way but confirm it with Ctrl+Shift+Enter (Command+Return on Mac) so it runs as an array formula. The rest of this guide covers the other reliable options, how they behave, and what to do when none of them seem to work.
Why bother? Error values such as #DIV/0!, #N/A or #VALUE! are contagious: a plain =SUM(A1:A20) returns an error the moment one cell in the range is broken, which hides the subtotal you actually need. Ignoring errors lets you total a column that is still being filled in, or one fed by lookups that occasionally miss.
What You'll Need
- A version of Excel (Microsoft 365, Excel 2021, 2019, 2016 or Excel for the web). The same functions exist in Google Sheets with identical syntax, and LibreOffice Calc handles IFERROR too.
- A range containing at least one number and, typically, one cell showing an error value.
- For older versions (2019 and earlier on Windows, 2019 and earlier on Mac), you need a way to enter array formulas: Ctrl+Shift+Enter, not just Enter.
- Basic comfort with cell references and the formula bar. No add-ins are required.
Step-by-Step
- Click the cell where the total should appear. Pick a cell outside the range you are summing, typically directly below the column or in a separate summary area, so the formula does not try to include itself.
- Type the IFERROR wrapper. Enter
=SUM(IFERROR(, then select or type your range, for exampleA2:A20, then close it:=SUM(IFERROR(A2:A20,0)). The0is the value substituted for every error cell. - Press Enter. In Microsoft 365, Excel 2021 and later, the formula calculates straight away and the result appears in that one cell. The range is handled internally, so you do not need a helper column.
- On older Excel, confirm with Ctrl+Shift+Enter. If you are on Excel 2019 or earlier, press Ctrl+Shift+Enter instead of Enter (Command+Return on a Mac). Excel wraps the formula in curly braces
{ }in the formula bar. That signals an array formula, and the total is correct. Typing the braces yourself does not work. - Check the answer against a filtered view. Select the range, look at the status bar at the bottom of the window, and compare the Sum shown there. If the status bar total does not match, a cell may contain text that looks like a number (for example a number stored as text, left-aligned), which SUM ignores rather than errors on.
- Copy the formula across or down if needed. Use relative references so each column or row recalculates for its own range. If your range should stay fixed, add dollar signs, for example
=SUM(IFERROR($A$2:$A$20,0)), then fill down. - Consider the alternatives if you prefer not to hide errors.
=SUMIF(A2:A20,"<1E+100")adds only values below a huge threshold and quietly skips errors and text without masking them with zeros;=AGGREGATE(9,6,A2:A20)sums while ignoring error values (option 6) without needing an array entry. AGGREGATE is available in Excel 2010 and later, so it is the tidiest choice for older installs. - Decide whether you want to know about the errors. IFERROR gives you a clean total but hides the fact that something in the source is broken. A common practice is to keep the clean total in one cell and add a companion formula such as
=COUNTIF(A2:A20,"#N/A")or=SUMPRODUCT(--ISERROR(A2:A20))elsewhere, so you can see how many errors were skipped. - Test by breaking a cell deliberately. Temporarily type
=1/0into an empty cell inside the range. A plain SUM will flip to #DIV/0!, while your wrapped formula keeps the total unchanged. Delete the test formula afterwards.
Common Mistakes
- Forgetting Ctrl+Shift+Enter on pre-2021 Excel. Without it,
=SUM(IFERROR(A2:A20,0))normally evaluates only the first cell of the range and returns a wrong answer with no error message. - Putting the total inside the summed range. If the formula sits in A20 and sums A2:A20, Excel reports a circular reference. Move the total out of the range.
- Using IFERROR to hide a real problem. Returning 0 for #N/A in a lookup column can silently understate totals. If the errors matter, investigate them rather than blanking them.
- Assuming SUM skips all errors. Plain SUM does not; it returns the first error it meets. Only the wrapping functions change that behaviour.
- Mixing text and numbers. A cell containing "1,200" as text is not an error, so IFERROR leaves it alone, but SUM ignores it. Convert with Text to Columns or multiply by 1 if those values should count.
- Reusing the same IFERROR for a sum of a whole column.
=SUM(IFERROR(A:A,0))includes the header row and any totals below the data. Use a precise range instead.
Tips
- Name your range (Formulas > Define Name) so the formula reads
=SUM(IFERROR(Sales,0)), which is easier to audit. - Use
AGGREGATE(9,6,range)when you want a single, non-array formula that ignores errors on any recent Excel version. - IFNA is narrower than IFERROR: it only masks #N/A, leaving other errors visible. Useful for lookups where a missing match is expected.
- Prefill the error check with conditional formatting: Home > Conditional Formatting > New Rule > Format only cells that contain > Errors. You then see error cells even though the total ignores them.
- When sending a workbook to someone else, note in a comment that the total ignores errors, so nobody assumes the source column is complete.
Troubleshooting
The formula returns a wrong, low number. Check whether the range is entered as an array. On Excel 2019 and earlier, re-enter with Ctrl+Shift+Enter. Also confirm no cells contain numbers stored as text; select them and use Data > Text to Columns > Finish to convert.
You still see an error in the result cell. An error inside the IFERROR expression itself, such as a broken reference or a typo in the range, is not caught. Check for #REF! in the formula bar and for stray spaces in the range.
The DAX or Power Query equivalent is needed. In Power Query, errors appear as "Error" values and can be removed or replaced before loading; in a PivotTable, right-click the field and use Value Field Settings where options exist, or clean the source. The Excel formula route is simplest for a one-off total.
Excel shows a circular reference warning. Move the total cell outside the range, then check Formulas > Error Checking > Circular References to locate the loop.
The result does not update. Press F9 to recalculate, or check Formulas > Calculation Options > Automatic. Manual calculation mode is a common reason a correct formula looks stale.
If none of that resolves it, rebuild the formula from scratch in a blank cell using the same range and compare the two results. This isolates whether the problem is the formula or the data.
Frequently Asked Questions
What is the simplest formula to sum a range while ignoring errors?
=SUM(IFERROR(A2:A20,0)). On Excel 2021 and later it works as typed; on older versions confirm it with Ctrl+Shift+Enter.
Does SUM automatically ignore error values?
No. A plain SUM returns the error. You must wrap it in IFERROR, use SUMIF with a large threshold, or use AGGREGATE with the ignore-errors option.
What is the difference between IFERROR and IFNA?
IFERROR replaces any error, including #DIV/0!, #VALUE! and #REF!. IFNA replaces only #N/A, leaving other errors visible so you notice them.
Can I sum only visible cells while ignoring errors?
Yes, though it needs care. SUBTOTAL with function number 109 sums visible rows, and you can wrap the underlying data in IFERROR first, or use AGGREGATE with the appropriate options. Plain SUM totals hidden rows too.
Why does AGGREGATE give a different result from IFERROR?
They should match for numeric data. A difference usually means one formula covers a different range, or AGGREGATE option 6 ignored rows that IFERROR counted as zero.
Does this work in Google Sheets?
Yes. =SUM(IFERROR(A2:A20,0)) and =AGGREGATE(9,6,A2:A20) both work with the same syntax in Google Sheets.