Logic function
Excel IFERROR function
IFERROR returns the result of a formula, or a value you choose if that formula gives any error. Use it to show "Not found", 0, or a blank instead of #N/A or #DIV/0! in reports.
=IFERROR(value, value_if_error)Arguments
value- The formula or value to check for an error.
value_if_error- What to return if value is an error, like "" or 0.
IFERROR examples
Every result below was calculated from this sample sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | |
|---|---|---|---|
| 1 | Rep | Calls | Deals |
| 2 | Nina | 120 | 18 |
| 3 | Tom | 0 | 0 |
| 4 | Ivy | 85 | 9 |
| 5 | Raj | 140 | 25 |
Result: 0.15 shows as 15% with Percent format
Nina made calls, so there is no error and IFERROR returns her close rate: 0.15.
Result: 0
Tom made 0 calls, which would give #DIV/0!. IFERROR shows 0 instead.
Result: No such rep
Zoe is not on the list, so the friendly message replaces #N/A.
Result: 0.10588235294 shows as 10.6% with Percent format
Returning "" leaves the cell blank when there is an error. Ivy has calls, so her rate shows: about 10.6% once the cell is formatted as Percent.
How to use IFERROR
- Write the formula that might fail.
- Wrap it: type =IFERROR( before it.
- Add a comma and the value to show if it errors.
- Close the bracket and copy it down.
Common IFERROR mistakes
Hiding real problems
IFERROR catches every error, including typos that cause #NAME? or #REF!. Use IFNA when you only expect #N/A.
Returning "" and then summing
Empty text is ignored by SUM but breaks + and *. Return 0 if the cell feeds other math.
Wrapping every formula by habit
Errors are signals. Only wrap formulas where an error is expected and harmless.
IFERROR FAQ
How do I replace #N/A with 0 in Excel?
Wrap the formula: =IFERROR(VLOOKUP(A2,D:E,2,FALSE),0). For lookups, =IFNA(...,0) is safer because it leaves other errors visible.
What is the difference between IFERROR and IFNA?
IFERROR catches every error type. IFNA only catches #N/A, so mistakes like #REF! or #NAME? still show up.
How do I use IFERROR with VLOOKUP?
Put the whole VLOOKUP inside: =IFERROR(VLOOKUP(A2,Table,2,FALSE),"Not found"). Missing values then show your message.
Practice IFERROR in these lessons
Guides that use IFERROR
- How to separate first and last name in Excel
- How to use INDEX MATCH in Excel
- How to extract text before a character in Excel
- VLOOKUP vs XLOOKUP
- How to extract numbers from a string in Excel
- How to calculate percentage in Excel
- How to calculate percent change in Excel
- How to use IFERROR in Excel
Related functions
IFNAFallback for #N/A onlyIFPicks a result from a testVLOOKUPVertical lookupXLOOKUPModern lookup in any direction
Updated