Hands-On Excel

Hands-On Excel Challenges IFERROR

Excel IFERROR practice

=IFERROR(VLOOKUP(A2, $D$2:$E$6, 2, FALSE), "Not listed") shows the price, or "Not listed" when the lookup gives an error. Fix the formula first: IFERROR hides every error, including your own mistakes.

CoreAbout 3 minutesFree, no sign-upBy Updated

Try it yourself

14 · IFERROR · Core

Catch the error, not the bug

Column B should show each item's price from the price list, or "Not listed" for an item that isn't on it. Right now every row shows an error. Fix the formula, then catch the missing item.

Click B2 and read the error first: #REF! and #N/A mean different things. IFERROR(formula, "Not listed") shows your text instead of any error, so make sure the formula itself works before you wrap it.

order.xlsx
Ready

Write in the green cells, then press Check. Click a cell while typing to insert it, drag to select a range, F4 adds $, Esc cancels.

The guide · IFERROR

Syntax

=IFERROR(value, value_if_error)
=IFNA(value, value_if_na)

Excel works out the first argument. If it's an error, you get the second argument instead. If not, you get the result as normal.

IFERROR or IFNA?

IFERROR catches every error: #N/A, #REF!, #DIV/0!, #VALUE!, #NAME?. IFNA only catches #N/A, which is what a lookup gives when a value isn't found. For lookups, IFNA is the safer choice: "not found" becomes your message, and a real mistake in the formula still shows up.

The trap: hiding a bug

Suppose a lookup asks for column 3 of a 2-column table. Every row shows #REF!. Wrap it in IFERROR and every row says "Not listed". The sheet looks tidy and is completely wrong. So before you wrap a formula:

  1. Read the error. #N/A means "not found". #REF!, #VALUE! and #NAME? usually mean the formula itself is wrong.
  2. Fix the formula until only the rows you expect show an error.
  3. Then wrap it, and check that the message appears only where it should.

What the errors mean

ErrorUsually means
#N/Aa lookup didn't find the value
#REF!a reference to a cell or column that doesn't exist
#DIV/0!dividing by zero or an empty cell
#VALUE!the wrong kind of value, such as text in arithmetic
#NAME?a misspelled function, or text without quotes

Common mistakes

FAQ

How do I use IFERROR with VLOOKUP?
Wrap the whole lookup: =IFERROR(VLOOKUP(A2,$D$2:$E$6,2,FALSE),"Not listed"). If the lookup returns an error, the cell shows Not listed instead.
What is the difference between IFERROR and IFNA?
IFERROR replaces any error. IFNA replaces only #N/A, the not-found error from lookups, so other mistakes in the formula stay visible.
How do I hide #DIV/0! in Excel?
Use IFERROR, for example =IFERROR(B2/C2,""), or test the divisor first: =IF(C2=0,"",B2/C2).
Is it bad to use IFERROR?
Not when the error is expected, like a product that isn't in a price list. It is bad when it hides a formula mistake, because the sheet looks fine and is wrong.

All challenges

  1. 01 Add it upSUM Starter · 3 min
  2. 02 Find the averageAVERAGE Starter · 3 min
  3. 03 Write once, fill downRelative references Starter · 3 min
  4. 04 Lock it with $Absolute references Core · 3 min
  5. 05 Percent of a totalPercentages Starter · 3 min
  6. 06 Select to the end in one moveCtrl + Shift + arrow Core · 3 min
  7. 07 Pass or fail?IF Core · 3 min
  8. 08 Count the ones that matchCOUNTIF Core · 3 min
  9. 09 Add up with two conditionsSUMIFS Core · 3 min
  10. 10 Look it upVLOOKUP Core · 3 min
  11. 11 Find the right bracketVLOOKUP approximate match Core · 3 min
  12. 12 XLOOKUP, the modern wayXLOOKUP Core · 3 min
  13. 13 INDEX and MATCH togetherINDEX + MATCH Advanced · 3 min
  14. 14 Catch the error, not the bugIFERROR Core · 3 min
  15. 15 Split first and last namesLEFT, MID + FIND Core · 3 min
  16. 16 Mistake hunt: #N/A everywhereFixing #N/A Core · 3 min

Pro · coming soon

From first formula to job-ready.

100+ challenges on lookups, pivot tables, dates and text cleanup, an interview track modeled on the Excel tests employers use, and your progress saved across devices.

$29 one-time · early-bird price

You won't be charged today.

You're early!

Pro isn't open yet. We're building it right now. Leave your email and we'll hold the $29 early-bird price for you and tell you the day it launches.

We'll email you a link to confirm, then one email when Pro launches. Privacy