# IFERROR function in Excel

> IFERROR returns a value you choose when a formula results in an error, and the formula's normal result otherwise.

Source: https://spreadsheetpractice.com/functions/iferror · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** IFERROR returns a value you choose when a formula results in an error, and the formula's normal result otherwise.
- **Syntax:** `=IFERROR(value, value_if_error)`
- **Most common use:** `=IFERROR(B3/C3,0)` returns 0 (Raj has no orders: 0 instead of #DIV/0!)
- **Available in:** Every current version
- **Category:** [Logical functions](https://spreadsheetpractice.com/functions/category/logic)
- **Returns:** The result of value, or value_if_error when value is any error: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? or #NULL!.
- **Google Sheets:** Works the same way in Google Sheets.

## What it does

IFERROR returns a value you choose when a formula results in an error, and the formula's normal result otherwise. It keeps reports clean, turning #DIV/0! into 0 or a missing lookup into "Not found", but it also hides real mistakes, so wrap only the part you expect to fail.

## Syntax

`=IFERROR(value, value_if_error)`

| Argument | Required? | What it is |
|---|---|---|
| `value` | Required | The formula to evaluate. |
| `value_if_error` | Required | What to return if value is an error: a number, text in quotes, "" for a blank, or another formula. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| F2 | `=IFERROR(B3/C3,0)` | 0 | Raj has no orders: 0 instead of #DIV/0! |
| F3 | `=IFERROR(VLOOKUP(E2,A2:B4,2,FALSE),"Not found")` | Not found | Kim isn't in the list, so the fallback text shows |
| F4 | `=IFERROR(B2/C2,0)` | $400 | No error here, so the normal result comes through: revenue per order |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Rep | Revenue | Orders |  | Rep to find | Result |
| 2 | Ana | $4,800 | 12 |  | Kim | 0 |
| 3 | Raj | $0 | 0 |  |  | Not found |
| 4 | Lee | $3,150 | 9 |  |  | $400 |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| Hiding real errors | IFERROR catches every error, including typos (#NAME?) and broken references (#REF!). Wrap only the lookup or division you expect to fail, and use IFNA around lookups. |
| Returning 0 where a blank is better | A 0 drags down averages and shows up in charts. Return "" to leave the cell blank. |
| Debugging with IFERROR in place | Take IFERROR off while you build a formula, so you can see what is going wrong, then add it back. |

## Tips

- XLOOKUP has its own if_not_found argument, so it doesn't need IFERROR.
- Use IFNA instead when you only want to catch missing lookup values.

## Related functions

- [IFNA](https://spreadsheetpractice.com/functions/ifna): IFNA returns a fallback only when a formula results in #N/A, the error lookups give when a value is missing.
- [ISERROR](https://spreadsheetpractice.com/functions/iserror): ISERROR returns TRUE for any error value, such as #N/A, #VALUE!, #REF!, #DIV/0! or #NAME?.
- [XLOOKUP](https://spreadsheetpractice.com/functions/xlookup): XLOOKUP searches one column or row for a value and returns the matching item from another.
- [VLOOKUP](https://spreadsheetpractice.com/functions/vlookup): VLOOKUP looks for a value in the first column of a table and returns a value from another column in the same row.
- Comparison: [IFERROR vs IFNA](https://spreadsheetpractice.com/functions/compare/iferror-vs-ifna)

## Questions

### How do I hide #DIV/0! in Excel?

=IFERROR(B2/C2,0) shows 0, and =IFERROR(B2/C2,"") shows a blank, when the divisor is 0 or empty.

### What is the difference between IFERROR and IFNA?

IFERROR catches every type of error. IFNA catches only #N/A, so other problems such as #REF! or #VALUE! still show up.

### Can I use IFERROR with VLOOKUP?

Yes: =IFERROR(VLOOKUP(E2,A2:C20,3,FALSE),"Not found"). IFNA is safer, because it won't hide the #REF! from a wrong column number.

## Practice

A graded IFERROR exercise ("Unknown SKUs") is on [the IFERROR page](https://spreadsheetpractice.com/functions/iferror). It is checked instantly, then re-checked on changed data.

Lessons that use IFERROR:

- [Lesson 15: Tiered lookups & IFERROR](https://spreadsheetpractice.com/learn/tiered-lookups-iferror) (Pro)
- [Lesson 42: Handling errors on purpose](https://spreadsheetpractice.com/learn/errors-iferror-ifna) (Pro)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
