# How to check if a cell contains an error in Excel

Use ISERROR inside IF: =IF(ISERROR(D2),"Fix row","OK"). It is TRUE for #N/A, #VALUE!, #DIV/0! and every other error.

**Excel:** `=IF(ISERROR(D2),"Fix row","OK")` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E |
| --- | --- | --- | --- | --- |
| Order | Qty | Unit price | Total | Check |
| A-1 | two | 8 | =B2*C2 |  |
| A-2 | 3 | 12.5 | =B3*C3 |  |
| A-3 | 5 | 4.25 | =B4*C4 |  |
| A-4 | 2 | TBD | =B5*C5 |  |
| A-5 | 6 | 9.99 | =B6*C6 |  |
| A-6 |  | 7 | =B7*C7 |  |

Formula in E2, filled to E7: `=IF(ISERROR(D2),"Fix row","OK")`

Result: Fix row; OK; OK; Fix row; OK; OK

## How it works

ISERROR returns TRUE when the cell holds any error value. A-1 and A-4 have text where numbers belong, so their totals are #VALUE! and get flagged. A-6 has no quantity, which multiplies as 0 rather than erroring.

## Other ways

- `=IF(ISERROR(D2),"Fix row",D2)`: Shows the total itself when there is no error. (Shows the totals instead of "OK".)
- `=ISERROR(D2)`: The bare TRUE or FALSE, for filters and conditional formatting. (TRUE and FALSE instead of labels.)

## Common mistakes

- ISERR is TRUE for every error except #N/A, and ISNA only for #N/A. Use ISERROR to catch them all.
- `IF(ISERROR(x),"…",x)` calculates x twice. When you only need a replacement value, `IFERROR(x,"…")` does it once.

## Questions

**How do I highlight error cells?**

Use `=ISERROR(D2)` as a conditional formatting rule, or Go To Special, Formulas, Errors to select them.

**How do I check for #N/A only?**

`=IF(ISNA(D2),"Not found","OK")`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/check-if-a-cell-contains-an-error
