ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

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

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Logic
  3. IFERROR in Excel: Hide Errors the Right Way

IFERROR in Excel: Hide Errors the Right Way

By ExcelReady Team·Updated October 30, 2026·6 min read

The short answer

IFERROR returns a formula's normal result, or a value you choose if the formula gives an error: =IFERROR(value, value_if_error). For example, =IFERROR(B2/C2,0) shows 0 instead of #DIV/0!. It catches every error type, including mistakes in your own formula, so check the formula works first, and use IFNA for lookups.

Key takeaways

  • IFERROR has two parts: the formula to try, then what to show if it returns an error.
  • It catches every error type: #N/A, #DIV/0!, #VALUE!, #REF!, #NAME?, #NUM! and #NULL!.
  • Use "" to show an empty cell, but remember "" is text, not a number.
  • Because it hides every error, a typo can turn a whole column into fallback values without any warning.
  • For lookups, IFNA is safer: it replaces only #N/A, so real mistakes still show.
On this page+
  1. How does Excel IFERROR work?
  2. How to fix #DIV/0! with IFERROR
  3. How to use IFERROR with VLOOKUP and XLOOKUP
  4. Why can IFERROR be dangerous?
  5. How to show text instead of an error
  6. How do you sum a column that contains errors?
  7. What errors should you not hide?
  8. Practise it

Excel IFERROR swaps an error like #DIV/0! or #N/A for something cleaner, such as 0, a blank or a short message. It's one of the most useful functions for tidy reports, and one of the easiest to misuse. This guide shows how to use IFERROR, which fallback to choose, and how to avoid hiding mistakes you actually need to see.

How does Excel IFERROR work?#

IFERROR tries a formula. If the result is normal, you see it. If it's an error, you see your fallback instead.

Excel formula
=IFERROR(value, value_if_error)
PartWhat it meansExample
valueThe formula to tryB2/C2
value_if_errorWhat to show if that formula returns an error0, "" or "Not found"

IFERROR catches every error type: #N/A, #DIV/0!, #VALUE!, #REF!, #NAME?, #NUM! and #NULL!. That is both its strength and its risk. It works in Excel 2007 and every later version.

How to fix #DIV/0! with IFERROR#

Excel can't divide by zero, so a division by an empty cell or a 0 gives #DIV/0!. Here the average price is revenue divided by units, and two products sold nothing:

ProductRevenueUnits=B2/C2=IFERROR(B2/C2,0)=IFERROR(B2/C2,"")
Desk Lamp4200120353535
Office Chair00#DIV/0!0(blank)
Monitor Arm315045707070
Webcam00#DIV/0!0(blank)

Rows without an error keep their normal result. Only the error rows change.

Choose the fallback carefully:

  • 0 is a number, so totals and averages include it. That's fine for "overspend", but misleading for "average price": a price of 0 looks like a real price.
  • "" (two double quotes) shows an empty cell. SUM and AVERAGE skip it, which is usually what you want. It is empty text, though, so a formula like =D3+1 on it gives #VALUE!.
  • A short message like "New" or "No sales" tells readers why there's no number.

If you know which error you expect, you can test for its cause instead: =IF(C2=0,"",B2/C2). This only handles zero units and still lets any other error show.

How to use IFERROR with VLOOKUP and XLOOKUP#

Lookups return #N/A when the item isn't in the table. IFERROR turns that into a clear message:

Excel formula
=IFERROR(VLOOKUP(B5,$F$2:$H$8,2,FALSE),"Discontinued")

For lookups, IFNA is usually the better choice. It works the same way, =IFNA(value, value_if_na), but replaces only #N/A. If the formula has a real mistake, such as a column number past the edge of the table (#REF!), you still see it. IFNA needs Excel 2013 or later. Read the full IFERROR vs IFNA comparison, or learn why lookups return #N/A and how to fix it.

XLOOKUP (Excel 2021 and Microsoft 365) has its own fourth argument for this, so it needs no wrapper: =XLOOKUP(B2,$F$2:$F$8,$H$2:$H$8,"Check code"). Like IFNA, that argument only covers "not found", so other errors still show.

Why can IFERROR be dangerous?#

IFERROR hides every error, including the ones caused by your own typos. Here is a growth formula that should divide by last year's sales in B2:

Excel formula
=IFERROR((C2-B2)/B22,"New")

B22 is an empty cell below the table, so every row divides by zero and shows "New", even products that sold well last year. No warning appears. Without IFERROR, the #DIV/0! in every row would tell you something was wrong.

Two habits prevent this:

  1. Write and check the formula first, without IFERROR. Make sure the normal rows give the right answer.
  2. Wrap it last, and only when you know which error you expect and why.

How to show text instead of an error#

The fallback can be any value: a number, text in double quotes, a cell reference or another formula. The growth example shows text for new products:

Excel formula
=IFERROR((C2-B2)/B2,"New")
ProductLast YearThis YearGrowth
Desk Lamp400042005%
Standing Desk09600New
Monitor Arm35003150-10%
Keyboard2400288020%

The brackets around C2-B2 matter. Without them, Excel divides B2 by B2 first, then subtracts, because division comes before subtraction. Format the column as a percentage to see 5% rather than 0.05.

How do you sum a column that contains errors?#

SUM returns an error if any cell in its range holds one, so a single #DIV/0! breaks the total. You have two options.

The first is to fix each row with IFERROR, as above, and then sum the clean column. The second is to skip the errors in the total itself:

Excel formula
=AGGREGATE(9,6,D2:D7)
=SUM(IFERROR(D2:D7,0))

In AGGREGATE, 9 means SUM and 6 means "ignore error values". It works in Excel 2010 and later. The SUM(IFERROR(...)) version works as a normal formula in Microsoft 365 and Excel 2021. In older versions, confirm it with Ctrl+Shift+Enter (Windows) or Control+Shift+Return (Mac).

Both give the total of the rows that worked. Make sure that's what you want: a total that quietly leaves rows out can be as misleading as an error.

What errors should you not hide?#

Some errors are a message about your formula, not your data. Fix these instead of wrapping them:

ErrorUsual causeFix
#NAME?A misspelled function or text without quotesCorrect the spelling, add quotes
#REF!A reference to a deleted cell, or a column past the tableFix the reference
#VALUE!Text where Excel expected a numberClean the data, for example with VALUE or TRIM
#N/A from a lookup that should matchExtra spaces or numbers stored as textUse TRIM, or convert the numbers

To check the data before it reaches a calculation, use ISNUMBER, ISTEXT and ISBLANK. And if errors come from conditions that don't match, such as a code with no label, SWITCH has a default value for that: see the SWITCH function.

For every argument and more examples, see the IFERROR function guide.

Practise it#

Try the growth exercise on this page, then practise IFERROR in a live spreadsheet, including the typo that turns every row into "New". After that, practise fixing lookup errors: #N/A, #REF!, hidden spaces, and when to choose IFNA over IFERROR.

Try it yourself

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

Growth is (This Year - Last Year) / Last Year. The Standing Desk is new and sold 0 last year, so the division gives #DIV/0!. In D3, calculate its growth, but show New instead of an error: put (C3-B3)/B3 inside IFERROR.

fx
ABCDE
1
Product
Last Year
This Year
Growth
2
Desk Lamp
4000
4200
3
Standing Desk
0
9600
4
Monitor Arm
3500
3150
5
Keyboard
2400
2880
6
Headset
6000
5400
7
8
9

Tip: The whole calculation goes first inside IFERROR, then a comma, then the text to show in double quotes.

Practise this in a lesson

LessonIFERRORReplace ugly errors like #DIV/0! with a clean fallback value using IFERROR, and learn when hiding errors backfires.LessonFixing lookup errorsDiagnose #N/A, #REF! and silent wrong answers in lookups, then handle missing items gracefully.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 use IFERROR in Excel?

+

Wrap your formula in IFERROR and add a fallback value: =IFERROR(VLOOKUP(B2,F2:H8,2,FALSE),"Not found"). Normal results show as usual, and errors show the fallback.

How do I make IFERROR show a blank cell?

+

Use two double quotes as the fallback: =IFERROR(B2/C2,""). The cell looks empty, but it holds empty text, so formulas like =D2+1 on it give #VALUE!.

What is the difference between IFERROR and IFNA?

+

IFERROR replaces every error type. IFNA replaces only #N/A, the not-found error from lookups, so mistakes like #REF! or #NAME? still show up.

Is it bad to use IFERROR?

+

Not when you expect a specific error, like a division by zero or an item that isn't in a list. It becomes a problem when you wrap a formula you haven't checked, because it also hides your mistakes.

Which Excel versions have IFERROR?

+

IFERROR works in Excel 2007 and every later version, including Microsoft 365, Excel for Mac and Excel for the web. IFNA needs Excel 2013 or later.

Sources

  • IFERROR function - Microsoft Support
  • IFNA function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 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. How does Excel IFERROR work?
  2. How to fix #DIV/0! with IFERROR
  3. How to use IFERROR with VLOOKUP and XLOOKUP
  4. Why can IFERROR be dangerous?
  5. How to show text instead of an error
  6. How do you sum a column that contains errors?
  7. What errors should you not hide?
  8. Practise it

Keep reading

Logic· 6 min read

Excel Comparison Operators: =, <>, >, <, >=, <=

In Excel, "not equal to" is written <>, so =A2<>"Delivered" returns TRUE when A2 is anything other than Delivered. Excel has six comparison operators: = equal, <> not equal, > greater than, < less than, >= greater than or equal, and <= less than or equal. Each returns TRUE or FALSE.

Logic· 7 min read

The SWITCH Function in Excel (Turn Codes Into Labels)

The Excel SWITCH function compares one value with a list of options and returns the result paired with the first exact match: =SWITCH(D2,"P","Pending","S","Shipped","Other"). The last single value is the default, shown when nothing matches. Without a default, SWITCH returns #N/A. SWITCH needs Excel 2019 or later.

Logic· 6 min read

ISBLANK, ISNUMBER and ISTEXT in Excel

ISBLANK returns TRUE when a cell is completely empty, ISNUMBER returns TRUE when it holds a real number, and ISTEXT returns TRUE when it holds text. Each takes one cell, like =ISBLANK(C2). They are most useful inside IF, for example =IF(ISNUMBER(C2),"OK","Check"), to catch bad data before you calculate with it.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free