Smart Systems for Home

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

Excel Formula to Sum Ignoring Errors

· 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 a range while ignoring errors, wrap the range in AGGREGATE: =AGGREGATE(9,6,A1:A20). The 9 tells it to sum, the 6 tells it to skip error values, and the range is whatever you want added. That single line returns the total of every number in the range while quietly ignoring #DIV/0!, #N/A, #VALUE!, #REF!, #NUM! and #NAME?. AGGREGATE is the simplest fix, and it needs no helper column and no array entry on modern Excel. If you use an older version or want an alternative, the SUMIF wrapper and the IFERROR-plus-SUM array both work too, and each has trade-offs worth knowing before you commit.

What You'll Need

  • A version of Excel that supports AGGREGATE: Excel 2010 or later, Excel for Microsoft 365, or Excel on the web. The function does not exist in Excel 2007 or older.
  • Your source data in a contiguous range, ideally with the numbers in a single column so you can see where the errors come from.
  • Alternatively, if you must use the older array approach, a desktop copy of Excel, since array formulas are awkward to enter in some web and mobile clients.
  • Nothing else: no add-ins, no helper columns, no macros.

Step-by-Step

  1. Click the cell where the total belongs. Choose a cell outside the range you are summing, such as the row directly below your last data row, so the formula does not refer to itself.
  2. Type the AGGREGATE formula. Enter =AGGREGATE(9,6,A1:A20), replacing A1:A20 with your actual range. You can also select the range with the mouse after typing =AGGREGATE(9,6, and closing the parenthesis.
  3. Confirm what the two numbers mean. The first argument is the function number: 9 means SUM. The second is the options argument: 6 means "ignore error values." Other options exist (for example 7 ignores hidden rows as well as errors), but 6 is the one that skips errors only.
  4. Press Enter. The cell shows the sum of all numeric values in the range. Errors are skipped silently, and text is ignored just as SUM always ignores text.
  5. Drag the formula across or down if needed. If you are summing several columns, copy the formula sideways and let relative references adjust, or lock the rows with $ if your range should stay fixed.
  6. Check the answer against a manual count. Select the numeric cells in the range with the mouse while watching the status bar at the bottom of the window, which shows Sum and Count for the selection. The two totals should match once you exclude the error cells.

If you are on Excel 2007, or you need a formula that works everywhere including very old files, use the SUMIF alternative:

  1. Type =SUMIF(A1:A20,">=0") to add only values greater than or equal to zero. This ignores errors because they fail the comparison. It also ignores negative numbers, so it is only suitable when all your values are positive.
  2. If negatives are possible, use =SUMIF(A1:A20,"<>#N/A") — but note this only skips #N/A and text that is not an error; other errors will still break the total. For a universal fix on old versions, use the array form.
  3. For the array form, type =SUM(IFERROR(A1:A20,0)) in desktop Excel 2007, and confirm with Ctrl+Shift+Enter instead of Enter. Excel wraps the formula in braces automatically. In Excel 2010 and later the same formula works with a plain Enter because it is evaluated as a dynamic array.

Common Mistakes

  • Mixing up the two numbers in AGGREGATE. Writing =AGGREGATE(6,9,A1:A20) asks for a function that does not exist in the SUM slot and returns #VALUE!. Function first, options second.
  • Using option 4 or 5 instead of 6. Those options ignore nothing or ignore hidden rows only; they do not skip errors. Option 6 is the errors switch.
  • Expecting AGGREGATE to fix the source cells. It hides the errors from the total but leaves them in the sheet. Anyone reading the column still sees #DIV/0! or #N/A, which may matter for audits and charts.
  • Forgetting that charts do not benefit. A chart built directly on the error-filled range may still break or show gaps. You may need to clean the source with IFERROR first.
  • Using SUMIF with ">0" when zeros or negatives matter. That silently drops legitimate values and makes the total look right while being wrong.
  • Typing the array formula without Ctrl+Shift+Enter in old Excel. A plain Enter in Excel 2007 gives a wrong figure or an error because the IFERROR never evaluates across the whole range.
  • Hardcoding the range too small. If rows are added later, an A1:A20 reference misses them. Use a full-column reference like A:A with AGGREGATE, or convert the data to an Excel Table and refer to the column.

Tips

  • Pair AGGREGATE with other function numbers when you need them: 1 is AVERAGE, 2 is COUNT, 4 is MAX and 5 is MIN, all with option 6 to skip errors. The syntax stays identical.
  • If you want to know how many cells were skipped, subtract the count of valid numbers from the total cell count: =COUNTA(A1:A20)-AGGREGATE(2,6,A1:A20).
  • Fix errors at the source where possible. Wrapping the formulas that generate errors in IFERROR(...,0) or IFERROR(...,"") makes downstream totals, charts and lookups all behave.
  • AGGREGATE also has a second form with more arguments that lets you ignore nested SUBTOTAL and AGGREGATE results, useful in subtotaled reports.
  • Name your range (Formulas > Define Name) so the formula reads =AGGREGATE(9,6,SalesAmounts). It is easier to audit months later.
  • Keep a spare cell with a plain =SUM(A1:A20). When it returns an error while AGGREGATE returns a number, you have proof that error cells exist in the range.

Troubleshooting

The formula returns #VALUE! itself. Check argument order: function number first, options second. Also confirm you are not passing a text string as the range.

The total is lower than expected. AGGREGATE ignores text as well as errors. Numbers stored as text (left-aligned, often with a green triangle) are not counted. Convert them with Text to Columns or multiply by 1 in a helper column.

The formula returns #NAME?. Your Excel version may not recognise AGGREGATE, which points to Excel 2007 or an older file format. Use the IFERROR array or SUMIF approach instead.

Hidden rows are being counted. Option 6 does not ignore hidden rows. Use option 5 to ignore hidden rows, or 7 to ignore both hidden rows and errors.

Errors still appear in the result cell. If the error sits outside your referenced range, AGGREGATE cannot see it. Expand the range or check for a stray cell above or below the block.

If that did not work, select the range, open the Formulas tab and use Evaluate Formula to step through what each part returns. Then verify the range boundaries by pressing Ctrl+[ to jump to the referenced cells.

Frequently Asked Questions

Does AGGREGATE work in Excel for the web and mobile?

AGGREGATE is supported in Excel for the web and in the current mobile apps. The older Ctrl+Shift+Enter array method is unreliable in mobile clients, so prefer AGGREGATE there.

Can I sum a range that contains #N/A from VLOOKUP?

Yes. =AGGREGATE(9,6,range) skips #N/A along with every other error type. If you want to eliminate the errors rather than hide them, wrap the VLOOKUP in IFERROR.

Is there a difference between AGGREGATE and SUM(IFERROR())?

Both give the same total. AGGREGATE needs no array entry and is shorter; SUM(IFERROR()) is more portable to very old versions. AGGREGATE is generally faster on large ranges.

Why does AGGREGATE still count a cell that looks blank?

A cell containing a space or an empty string returned by a formula is text, not truly blank, and text is ignored for summing. If it counts, the cell likely holds a number hidden by cell formatting.

Can I ignore only one kind of error?

Not with AGGREGATE directly. To skip only #N/A, use =SUMIF(range,"<>#N/A"), though other error types will still break the total.

Does this work in Google Sheets?

Google Sheets supports AGGREGATE with the same syntax, and the array form =SUM(IFERROR(range,0)) also works without special key presses.