The IFERROR function
Returns a value you choose when a formula gives any error, and the formula result otherwise.
Syntax
IFERROR(value, value_if_error)- value
- The formula to check.
- value_if_error
- What to show instead of an error, such as 0 or "Not found".
Examples
B1
=IFERROR(110/0,20)| A | B | |
|---|---|---|
| 1 | 0 |
In plain words: 1Divide 10 by 0, and 2if that gives an error, show 0 instead.
D1=IFERROR(VLOOKUP("Kiwi",A2:B4,2,FALSE),"Not found")
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Fruit | Price | Not found | |
| 2 | Apple | 4 | ||
| 3 | Pear | 6 | ||
| 4 | Plum | 5 |
Practice IFERROR
Read the guide
Questions
Should I use IFERROR or IFNA?
IFNA only catches #N/A, the error a lookup gives when nothing matches. IFERROR also hides real mistakes such as #REF! or #NAME?, so prefer IFNA around lookups.