Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel SUM Ignore Errors: Safe Totals Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To sum values in Excel while ignoring errors like #DIV/0!, #N/A, or #VALUE!, use the AGGREGATE function: =AGGREGATE(9,6,range). This adds all numbers in the range and simply skips any cells that contain an error. It works in Excel 2010 and later, and in Excel for Microsoft 365. If you need to ignore only specific error types, or you are on an older version, use SUM combined with IFERROR or the SUMIF function instead. Below are step-by-step methods for each approach, plus what to do when the result still looks wrong.

What You'll Need

  • Excel 2010 or later (AGGREGATE is not available in Excel 2007 or earlier). Excel for Microsoft 365, Excel 2019, 2021, and Excel for Mac 2011+ all support it.
  • A range of cells that contains numbers and one or more error values (such as #DIV/0!, #N/A, #VALUE!, #REF!, #NUM!, #NAME?).
  • Basic familiarity with entering formulas in the formula bar.

Step-by-Step

Method 1: AGGREGATE (fastest, ignores all errors)

  1. Click the cell where you want the total to appear.
  2. Type =AGGREGATE(9,6, and then select your range with the mouse, or type it (for example B2:B100).
  3. Close the parenthesis and press Enter. The formula should look like =AGGREGATE(9,6,B2:B100).
  4. Check the result: it should equal the sum of all numeric cells in the range, with error cells silently skipped.
  5. If you want to ignore hidden rows as well, change the second argument from 6 to 5: =AGGREGATE(9,5,B2:B100). Argument 6 ignores errors but includes hidden rows; argument 5 ignores both errors and hidden rows.

How it works: The first number (9) tells AGGREGATE to perform a SUM. The second number (6) is the option that says "ignore error values." You can use other function numbers with AGGREGATE (for example 1 for AVERAGE, 2 for COUNT, 4 for MAX), but 9 is the one for summing.

Method 2: SUM with IFERROR (works in all versions, but requires an array formula in older Excel)

  1. Select the destination cell.
  2. Type =SUM(IFERROR( and then select your range.
  3. Type ,0)) and press Enter. In Excel for Microsoft 365 and Excel 2021, this works as a normal formula. In Excel 2019 and earlier, you must press Ctrl+Shift+Enter to enter it as an array formula; otherwise you will get a #VALUE! error or an incorrect result.
  4. Confirm the formula bar shows curly braces { } around the formula if you used Ctrl+Shift+Enter. Do not type the braces yourself.

This method replaces every error with 0 and then sums the numbers. It is reliable but slightly longer to type, and the array-entry requirement trips people up on older versions.

Method 3: SUMIF (ignores errors automatically, but only sums numeric values)

  1. Select the destination cell.
  2. Type =SUMIF( and select your range, then type ,">=0" (or ,">=0" depending on your locale) and close the parenthesis. The full formula looks like =SUMIF(B2:B100,">=0").
  3. Press Enter. SUMIF sums only cells that meet the criteria; error cells do not meet the criteria, so they are ignored.

Limitation: This only works if all your valid numbers are zero or positive. If the range contains negative numbers, they will be excluded because they are less than 0. To include negatives, use "<>" as the criteria, but that also sums text cells as zero (which is fine) and still ignores errors. Test with a small sample first.

Method 4: Fix the errors at the source (best long-term)

  1. Select the range and use Home > Find & Select > Go To Special > Formulas > Errors to highlight all error cells at once.
  2. Inspect each error: click a cell and read the formula in the formula bar. Common causes are division by zero, a lookup that found no match, or text where a number is expected.
  3. Correct the underlying formula. For example, wrap a VLOOKUP in IFERROR to return 0 or a blank instead of #N/A: =IFERROR(VLOOKUP(...),0).
  4. Once errors are fixed, a plain =SUM(range) will work normally and no special function is needed.

Common Mistakes

  • Using the wrong AGGREGATE option number. Option 6 ignores errors but includes hidden rows; option 5 ignores both errors and hidden rows. If your total seems too low, check whether rows are hidden and whether you meant to include them.
  • Forgetting Ctrl+Shift+Enter in older Excel. The SUM(IFERROR(...)) formula returns #VALUE! or a wrong total if entered as a normal formula in Excel 2019 and earlier. Look for the curly braces in the formula bar.
  • Assuming SUMIF handles negatives. The ">=0" criteria excludes negative numbers. Use AGGREGATE or SUM(IFERROR(...)) if your data has negatives.
  • Including text cells that look like numbers. AGGREGATE and SUM ignore text, but if a cell contains a number stored as text (often left-aligned), it will not be summed. Convert it with Data > Text to Columns or by multiplying by 1.
  • Referencing whole columns in array formulas. =SUM(IFERROR(A:A,0)) entered as an array can be slow. Use a bounded range like A2:A1000 instead.

Tips

  • Use Formulas > Evaluate Formula to step through a formula and see exactly which cells are being summed and which are being skipped.
  • Name your ranges (Formulas > Define Name) so formulas like =AGGREGATE(9,6,SalesData) are easier to read and audit.
  • If you need a count of errors separately, use =COUNTIF(range,"#N/A") or =SUMPRODUCT(--ISERROR(range)) to see how many cells are being ignored.
  • AGGREGATE also works with other functions: replace 9 with 1 for AVERAGE, 2 for COUNT, 4 for MAX, 5 for MIN. The second argument (6) stays the same to ignore errors.
  • In Excel for the web, AGGREGATE is supported. SUM(IFERROR(...)) also works without array entry because the web version uses dynamic arrays.

Troubleshooting

The total is still an error. Check that your range reference is correct and that the error is not in a cell outside the range. Also confirm you are using the right function number: 9 for SUM. If you typed the formula manually, make sure the parentheses are balanced.

AGGREGATE returns #VALUE!. This usually means the range contains an error that AGGREGATE cannot ignore with the chosen option, or the option number is invalid. Valid option numbers are 0–7 and 8–11 for the second argument. Use 6 to ignore errors.

The total is lower than expected. Some cells may contain numbers stored as text. Select the range and look at the status bar: if it shows a count but the sum is smaller, text numbers are present. Convert them with Data > Text to Columns (choose General format) or by using VALUE() in a helper column.

SUM(IFERROR(...)) gives #VALUE! in Excel 2019. You forgot Ctrl+Shift+Enter. Re-enter the formula as an array formula. Alternatively, switch to AGGREGATE, which does not require array entry.

The formula works but recalculates slowly. Large array formulas over whole columns can be slow. Limit the range to the actual data area, or use AGGREGATE, which is generally faster.

Frequently Asked Questions

Can I sum a range that contains #N/A and #DIV/0! at the same time?

Yes. AGGREGATE with option 6 ignores all error types, including #N/A, #DIV/0!, #VALUE!, #REF!, #NUM!, and #NAME?. SUM(IFERROR(...)) also handles all error types.

Does AGGREGATE work in Excel for Mac?

Yes, AGGREGATE is available in Excel for Mac 2011 and later. The syntax is the same.

What if I only want to ignore #N/A but keep other errors visible?

Use SUMIF with a criteria that excludes #N/A, or use an array formula like =SUM(IF(ISNA(range),0,range)) entered with Ctrl+Shift+Enter. This replaces only #N/A with 0 and leaves other errors to propagate.

Can I use AGGREGATE with a filter or hidden rows?

Yes. Use option 5 instead of 6 to ignore both errors and hidden rows. This is useful when you filter a table and want the total to reflect only visible rows.

Why does my SUM(IFERROR(...)) formula return 0?

If all cells in the range are errors, the formula returns 0 because every error is replaced with 0. Check the range and the underlying data.

Is there a way to sum without ignoring errors but still get a result?

No. If any cell in a plain SUM range contains an error, the SUM returns that error. You must either fix the error or use one of the methods above to ignore it.