How to check if a cell contains an error in Excel
Formula (Excel and Google Sheets)
=IF(ISERROR(D2),"Fix row","OK")Use ISERROR inside IF: =IF(ISERROR(D2),"Fix row","OK"). It is TRUE for #N/A, #VALUE!, #DIV/0! and every other error.
- Result on the example
- one result per row in
E2, filled down toE7 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in E2, filled down to E7. Change any input and the result updates, or edit the formula to experiment.
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.
=IF(ISERROR(D2),"Fix row","OK")In Google Sheets
The same formula works in Google Sheets: =IF(ISERROR(D2),"Fix row","OK"). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =IF(ISERROR(D2),"Fix row",D2) | Fix row, 37.5, 21.25…Different result | Shows the total itself when there is no error. Shows the totals instead of "OK". |
| =ISERROR(D2) | TRUE, FALSE, FALSE…Different result | 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.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Check if a cell contains an error
E2, show "Fix row" when the total in D2 is an error, otherwise "OK". Fill down to E7.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").
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.