Syntax
=IFERROR(value, [value_if_error])
value- The formula to try.
value_if_error- Optional. What to show if it errors (defaults to an empty cell).
IFERROR returns a value you choose when a formula results in an error, and the normal result otherwise. Use it to replace #N/A, #DIV/0! and friends with something readable.
=IFERROR(value, [value_if_error])
valuevalue_if_errorCalculate revenue per click for the first campaign (B2 ÷ C2). Some campaigns have 0 clicks, so show 0 instead of an error.
Tip: while typing a formula, click a cell or drag across cells to insert references. Press Enter to check, and Tab to accept a function suggestion.
Each example below runs against this sample sheet. The results are calculated by the same engine as the practice grid.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Emp ID | Name | Dept | Salary | |
| 2 | 1042 | Maya Patel | Finance | maya.patel@acme.co | $72,000.00 |
| 3 | 1187 | Leo Rossi | Support | leo.rossi@acme.co | $51,000.00 |
| 4 | 1305 | Ava Kim | Sales | ava.kim@acme.co | $64,000.00 |
| 5 | 1411 | Omar Ali | Marketing | omar.ali@acme.co | $58,000.00 |
| 6 | 1520 | Hana Tanaka | Sales | hana.tanaka@acme.co | $69,000.00 |
| Formula | Result | What it shows |
|---|---|---|
=IFERROR(VLOOKUP(9999, A2:C6, 2, FALSE), "Not found") | Not found | The ID doesn't exist, so the fallback is shown. |
=IFERROR(VLOOKUP(1187, A2:C6, 2, FALSE), "Not found") | Leo Rossi | No error, so the normal result comes through. |
=IFERROR(E2 / 0, 0) | 0 | Division by zero becomes 0. |
Learning step by step? IFERROR is covered in Lesson 9: IFERROR & IFNA of the free course.