How to use IFERROR in Excel
IFERROR returns your formula's result, or a value you choose if the formula gives an error. It turns #DIV/0! into 0 and #N/A into "Not found".
Syntax
=IFERROR(value, value_if_error)
value- The formula to try.
value_if_error- What to show instead of an error:
0,""or a message in quotes.
Try it now · free, no sign-up
Clean up errors
- In D2, divide Revenue by Units, but show
0instead of #DIV/0! when Units is 0. It will be copied down. - In G2, look up the revenue for the item in F2. Scissors is not in the list, so show
Not found.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Item | Revenue | Units | Per unit | Find item | Revenue | |
| 2 | Notebooks | 450.00 | 30 | Scissors | |||
| 3 | Pens | 0.00 | 0 | ||||
| 4 | Backpacks | 900.00 | 20 | ||||
| 5 | Binders | 0.00 | 0 | ||||
| 6 | Markers | 96.00 | 24 |
Loading the live spreadsheet…
IFERROR or IFNA?
IFERROR hides every error, including ones that point to a real mistake such as a misspelled function (#NAME?). IFNA only catches #N/A, which is safer for lookups. In XLOOKUP, use its own fourth argument instead.
Common mistakes
- Hiding real mistakes
- Wrap a formula in IFERROR only after you have checked it works. Otherwise a broken formula quietly shows 0.
- Text without quotes
- Write
"Not found", notNot found.
Practice it until it sticks
ExcelFluent has 42 hands-on lessons, from SUM to XLOOKUP, plus 5 real work projects and a final challenge that uses everything. Every answer is checked instantly. The first 5 lessons and 1 work project (an invoice with tax) are free.
Start the free lessons → Open the full IFERROR lessonFrequently asked questions
Does IFERROR slow down Excel?
Not noticeably for normal sheets.
Which Excel errors does IFERROR catch?
#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? and #NULL!.