IFERROR in Google Sheets
Returns a value you choose when a formula gives any error, and the formula result otherwise.
In Google Sheets
IFERROR works the same way in Google Sheets. There you may also leave out the second argument, which gives an empty cell.
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 |