Excel IFERROR function: replace errors with a clean value
IFERROR returns a value you choose when a formula errors. =IFERROR(VLOOKUP("South",$J$2:$L$4,2,FALSE),"Not found") shows Not found instead of #N/A, because South isn't in the table.
The lookup examples use this small table in J1:L4, next to the sales data:
| J Region | K Manager | L Rate | |
|---|---|---|---|
| 2 | East | Ann Cole | 5% |
| 3 | West | Ben Ortiz | 4% |
| 4 | North | Cara Lim | 6% |
Syntax
=IFERROR(value, value_if_error)
Examples
=IFERROR(VLOOKUP("South",$J$2:$L$4,2,FALSE),"Not found")returns Not found.=IFERROR(B2/F2,0)returns 0 instead of #DIV/0! when the units cell is blank or zero.
Errors it catches
#N/A, #DIV/0!, #VALUE!, #REF!, #NAME?, #NUM! and #NULL!. All of them.
When not to use it
IFERROR hides every error, including real mistakes. If you misspell a function name, it shows your fallback value and you never see the #NAME? warning. Build and test the formula first, then wrap it.
If you only expect missing lookups, IFNA is safer because it only catches #N/A. XLOOKUP has its own not-found argument, so it doesn't need either.
Try it: Lookup with a fallback
There is no South region in the table. In C2, look up the manager for "South" and show Not found instead of an error.
Graded live, like a real Excel test. Press New numbers to prove you didn't memorize the answer. More practice
Questions people ask
What's the difference between IFERROR and IFNA?
IFERROR catches every error type. IFNA only catches #N/A, so other mistakes still show up.
Can IFERROR return a blank?
Yes. Use two quotes: =IFERROR(B2/F2,"").
Practice on a real spreadsheet
CellReady grades your formula the moment you press Enter and tells you why a wrong answer is wrong. The first 7 lessons are free, with no sign-up to start.
Related guides
How VLOOKUP works in Excel, why you should always end it with FALSE, how to lock the table with $, its limits, and a live exercise.
How the Excel IF function works, with text and number results, AND and OR, nested IFs, the #NAME? mistake, and a live exercise.
How XLOOKUP works in Excel and Google Sheets, how it compares to VLOOKUP, the built-in not-found value, which versions have it, and a live exercise.