Free IFERROR practice
IFERROR practice exercises
IFERROR returns a value of your choice instead of an error, such as #N/A from a lookup that finds nothing. 5 reps, from easy to hard, each checked in a real spreadsheet engine. 2 free, 3 with Pro.
=IFERROR(value, value_if_error)
IFERROR guide
How to use IFERROR in Excel
IFERROR returns a value of your choice instead of an error. It's most often wrapped around a lookup, so a missing code shows 0 or "Not found" instead of #N/A, or around a division that might divide by zero.
If the formula works, IFERROR passes its result through untouched. Use it on purpose: it hides every kind of error, including mistakes in your own formula.
Syntax
=IFERROR(value, value_if_error)
| Argument | What it is |
|---|---|
value | The formula to try, such as a VLOOKUP. |
value_if_error | What to show if that formula returns any error: 0, "" for an empty-looking cell, or a message in quotes. |
Examples
#N/A the cell shows 0.| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Code | Price | |
| 2 | P-101 | Desk | 249 | P-999 | 0 | |
| 3 | P-102 | Chair | 129 | |||
| 4 | P-103 | Lamp | 39 | |||
| 5 | P-104 | Shelf | 89 |
=IFERROR(VLOOKUP(E2,A2:C5,3,FALSE),0) returns 0.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Code | Product | Price | Code | Price | |
| 2 | P-101 | Desk | 249 | P-102 | 129 | |
| 3 | P-102 | Chair | 129 | |||
| 4 | P-103 | Lamp | 39 | |||
| 5 | P-104 | Shelf | 89 |
=IFERROR(VLOOKUP(E2,A2:C5,3,FALSE),0) returns 129.
#DIV/0!.| A | B | C | D | |
|---|---|---|---|---|
| 1 | Rep | Sales | Orders | Per order |
| 2 | Ana | 5200 | 8 | |
| 3 | Ben | 0 | 0 | No orders |
=IFERROR(B3/C3,"No orders") returns No orders.
Common mistakes
Hiding a mistake in your own formula
The table has 3 columns, so column 4 is a #REF! error. IFERROR turns it into 0, so the mistake looks like a missing price. Get the formula right before wrapping it.
Wrong=IFERROR(VLOOKUP("P-103",A2:C5,4,FALSE),0) → 0
Right=IFERROR(VLOOKUP("P-103",A2:C5,3,FALSE),0) → 39
Wrapping the wrong part
IFERROR must wrap the formula that fails. Wrapping only the lookup value does nothing; the VLOOKUP around it still returns #N/A.
Wrong=VLOOKUP(IFERROR("P-999",0),A2:C5,3,FALSE) → #N/A
Right=IFERROR(VLOOKUP("P-999",A2:C5,3,FALSE),0) → 0
IFERROR questions
What is the difference between IFERROR and IFNA?
IFNA only catches #N/A, the error a lookup returns when it finds nothing. IFERROR catches every error. IFNA is safer around lookups because real mistakes such as #REF! still show.
How do I show a blank instead of an error?
Use two double quotes: =IFERROR(VLOOKUP(E2,A2:C5,3,FALSE),"").
Should I use IFERROR with XLOOKUP?
Usually not. XLOOKUP has its own fourth argument for a missing value: =XLOOKUP(E2,A2:A5,C2:C5,0).
Related functions
Reading is the warm-up
The reps are what make it stick. Try IFERROR in the practice sheet above.