ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Math
  3. How to Sum and Ignore Errors in Excel

How to Sum and Ignore Errors in Excel

By ExcelReady Team·Updated November 2, 2026·6 min read

The short answer

To sum a range and ignore errors in Excel, use =AGGREGATE(9,6,B2:B7), where 9 means SUM and 6 means ignore error values. Or use =SUM(IFERROR(B2:B7,0)), which turns each error into 0 before adding. Both skip #N/A, #DIV/0! and other errors. Fixing the errors at the source is often the better long-term answer.

Key takeaways

  • SUM returns an error if any cell in the range contains one.
  • =AGGREGATE(9,6,range) sums and skips errors; option 7 also skips hidden rows.
  • =SUM(IFERROR(range,0)) works as a normal formula in Excel 2021 and Microsoft 365.
  • =SUMIF(range,"<9.99E+307") skips errors in any version without special keys.
  • A total that skips errors can hide missing data, so count the errors too.
On this page+
  1. Why SUM returns an error
  2. Method 1: Sum and ignore errors with AGGREGATE
  3. Method 2: Sum and ignore errors with SUM and IFERROR
  4. Method 3: The SUMIF trick for any version
  5. Which method should you use?
  6. How to fix errors at the source
  7. How to count the errors you skipped
  8. Practise it

To sum and ignore errors in Excel, use =AGGREGATE(9,6,B2:B7) or =SUM(IFERROR(B2:B7,0)). A plain SUM stops at the first error and shows it as the result, so one #N/A from a lookup or one #DIV/0! breaks the whole total. This guide shows three formulas that skip errors, when to use each, and how to find the errors so you don't hide a real problem.

Why SUM returns an error#

SUM adds numbers, and it skips text and blank cells. But if any cell in its range holds an error value, such as #N/A, #DIV/0! or #VALUE!, SUM returns that error instead of a total. Here is a store report where two cells failed:

AB
1StoreSales
2Leeds1,250
3York#DIV/0!
4Hull980
5Bath1,410
6Derby#VALUE!
7Ely760

=SUM(B2:B7) returns #DIV/0!, not a number. The total of the four good cells is 4,400 (1,250 + 980 + 1,410 + 760). Every method below returns 4,400. If SUM itself is new to you, start with the SUM function guide or the article on using SUM in Excel.

Method 1: Sum and ignore errors with AGGREGATE#

AGGREGATE does SUM, AVERAGE, MAX and more, and it can skip errors. The syntax is:

Excel formula
=AGGREGATE(function_num, options, ref1, ...)

For a sum that ignores errors:

Excel formula
=AGGREGATE(9,6,B2:B7)
  • 9 tells AGGREGATE to SUM.
  • 6 tells it to ignore error values.
  • B2:B7 is the range.

The result is 4,400. AGGREGATE works in Excel 2010 and later, on Windows and Mac. Excel shows a list of function numbers and options as you type, so you don't have to remember them.

Two other options are worth knowing. Option 7 ignores errors and hidden rows, which is useful on a filtered list. Option 5 ignores hidden rows only. Change the first number to get other results: 1 for AVERAGE, 4 for MAX, 5 for MIN. For example, =AGGREGATE(4,6,B2:B7) returns the highest sale, 1,410.

AGGREGATE has one limit to know. With a range like B2:B7, it skips errors and, with option 7, hidden rows. But if you give it a calculation instead of a range, such as B2:B7*2, only some of its functions accept that. For a plain total of a column, the form shown here always works.

Method 2: Sum and ignore errors with SUM and IFERROR#

Wrap the range in IFERROR to turn each error into 0, then add:

Excel formula
=SUM(IFERROR(B2:B7,0))

IFERROR checks each cell in B2:B7. Numbers pass through unchanged, and errors become 0. SUM then adds the clean list and returns 4,400. The IFERROR function guide explains the two arguments.

In Excel 2021 and Microsoft 365, press Enter as usual. In Excel 2019 and earlier, this is an array formula, so confirm it with Ctrl+Shift+Enter. If you press plain Enter in an older version, you may get the wrong answer or an error.

To skip only #N/A and still see other errors, use IFNA instead: =SUM(IFNA(B2:B7,0)). On this data it still returns #DIV/0!, because IFNA doesn't catch that error. That is useful when a missing lookup value is expected but a division error is a real bug.

Method 3: The SUMIF trick for any version#

SUMIF only adds cells that meet its criteria, and an error never meets a number test. So a criteria that every normal number passes will skip all errors:

Excel formula
=SUMIF(B2:B7,"<9.99E+307")

9.99E+307 is close to the largest number Excel can store, so every real number is smaller. The result is 4,400, with no special keys and in every version of Excel. The downside is that the formula is hard to read, so add a note for whoever opens the file next.

Which method should you use?#

All three give the same total. Pick by version and by what else you need.

MethodFormulaWorks inBest for
AGGREGATE=AGGREGATE(9,6,B2:B7)Excel 2010 and laterMost cases, filtered lists (option 7)
SUM + IFERROR=SUM(IFERROR(B2:B7,0))Enter in 2021/365; Ctrl+Shift+Enter beforeReadable formulas, skipping only #N/A with IFNA
SUMIF=SUMIF(B2:B7,"<9.99E+307")All versionsVery old files, no array formulas

SUBTOTAL is not on the list. It ignores hidden rows but not errors, so one error still breaks it. The comparison of SUBTOTAL vs SUM explains what SUBTOTAL does skip. For a total of only the rows a filter shows, see how to filter and sum.

How to fix errors at the source#

Skipping errors in the total is quick, but the errors are still in the sheet. Often it is better to stop them appearing. If column B is filled by formulas, wrap each one:

Excel formula
=IFERROR(VLOOKUP(A2,Prices!A:B,2,FALSE),0)

Now each row shows 0 instead of #N/A, and a plain SUM works. Use this only when 0 is a true answer. If a store's sales are unknown, a blank ("") is more honest than 0, and SUM skips blanks too.

The same idea applies across a wider sheet or several sheets. The guides to summing multiple columns and summing across sheets work with any of these methods.

How to count the errors you skipped#

A total that quietly leaves out two stores can mislead as much as an error. Count the errors next to the total:

Excel formula
=SUMPRODUCT(--ISERROR(B2:B7))

ISERROR returns TRUE for each error. The double minus (--) turns TRUE into 1 and FALSE into 0, and SUMPRODUCT adds them. The result is 2. A label such as "Total 4,400 (2 stores missing)" tells readers exactly what they are looking at.

To find the error cells themselves, use Home > Find & Select > Go To Special, choose Formulas, and tick only Errors. Excel selects every formula cell that shows an error.

Practise it#

Practise IFERROR in a live spreadsheet: you wrap formulas that fail and the sheet checks your answer instantly. Then try the exercise on this page, which totals a column with two errors, and review the basics in the SUM lesson.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Two stores show errors, so a plain SUM fails. In D2, total the Sales column (B2:B7) and ignore the errors with SUM and IFERROR.

fx
ABCDE
1
Store
Sales
Total sales
2
Leeds
1250
3
York
#DIV/0!
4
Hull
980
5
Bath
1410
6
Derby
#VALUE!
7
Ely
760
8
9
10

Tip: IFERROR(B2:B7,0) turns every error in the range into 0. Put it inside SUM.

Practise this in a lesson

LessonIFERRORReplace ugly errors like #DIV/0! with a clean fallback value using IFERROR, and learn when hiding errors backfires.LessonSUM and AutoSumAdd up a column of numbers with SUM, then let AutoSum write the formula for you.Function guideSUMAdd up columns, rows and separate ranges with Excel's SUM function. Clear examples, common mistakes and a live practice exercise.Function guideIFERRORUse IFERROR to swap #N/A, #DIV/0! and other errors for a clean value. Examples with division and VLOOKUP, pitfalls, and live practice.

Frequently asked questions

How do I sum a column with #N/A in Excel?

+

Use =AGGREGATE(9,6,B2:B7) or =SUM(IFERROR(B2:B7,0)). Both add the numbers and skip the #N/A cells. To skip only #N/A, use =SUM(IFNA(B2:B7,0)).

Why does my SUM formula return #N/A or #DIV/0!?

+

One or more cells in the range contain that error, and SUM passes the first error it meets on to the result. Find the error cells and fix them, or use AGGREGATE to skip them.

Does SUBTOTAL ignore errors?

+

No. SUBTOTAL ignores hidden and filtered rows, but an error in a visible cell still breaks the result. Use AGGREGATE with option 7 to skip both hidden rows and errors.

How do I average and ignore errors?

+

Use AGGREGATE with function 1 for AVERAGE: =AGGREGATE(1,6,B2:B7). It averages only the cells that hold numbers.

How do I count the errors in a range?

+

Use =SUMPRODUCT(--ISERROR(B2:B7)). ISERROR returns TRUE for each error, the double minus turns TRUE into 1, and SUMPRODUCT adds them up.

Sources

  • AGGREGATE function - Microsoft Support
  • IFERROR function - Microsoft Support
  • SUMIF function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Why SUM returns an error
  2. Method 1: Sum and ignore errors with AGGREGATE
  3. Method 2: Sum and ignore errors with SUM and IFERROR
  4. Method 3: The SUMIF trick for any version
  5. Which method should you use?
  6. How to fix errors at the source
  7. How to count the errors you skipped
  8. Practise it

Keep reading

Math· 5 min read

The Excel SUM Function: A Beginner's Guide

The Excel SUM function adds numbers. Type =SUM( then the cells to add, then ), for example =SUM(B2:B5) to add B2 through B5. A colon makes a range, and a comma adds separate cells or ranges, like =SUM(B2,B4:B5). SUM skips text and empty cells, so it doesn't break on gaps.

Math· 6 min read

How to Sum Multiple Columns in Excel

To sum multiple columns in Excel, give SUM a range that covers them all, like =SUM(B2:D5), which adds every number in columns B, C and D. For columns that aren't next to each other, separate the ranges with commas: =SUM(B2:B5,D2:D5). For a total per row, use =SUM(B2:D2) and fill it down.

Dynamic arrays· 6 min read

Sum, Count or Average FILTER Results in Excel

To sum FILTER results in Excel, put FILTER inside SUM: =SUM(FILTER(D2:D9,B2:B9="East")) adds the sales of East rows only. Swap SUM for COUNT, AVERAGE or MAX for other answers. Add 0 as FILTER's third argument so no matches return 0 instead of #CALC!. To total rows left visible by the filter buttons, use =SUBTOTAL(109,D2:D9).

More on math

  • How to Sum the Top 5 (or Top N) Values in Excel
  • How to Sum Only Visible (Filtered) Cells in Excel
  • Why Your Excel Total Is Wrong (and How to Fix It)
  • SUMPRODUCT in Excel: Multiply and Add in One Step
  • How to Calculate a Weighted Average in Excel
  • Absolute References and the $ Sign in Excel
All math articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free