Check if a Cell Has an Error

Excel Formulas › Information

All versionsISERRORISNA

To test whether a formula produced an error — flag it, count it, branch on it — use ISERROR (any error) or ISNA (only #N/A). They return TRUE/FALSE so you can react however you like.


Quick formula: to label a calculation as error or OK:
=IF(ISERROR(A2/B2), "Check input", "OK")
ISERROR tests the inner formula; if it would error (like divide-by-zero), it returns TRUE without showing the error.

Functions used (tap for the full reference guide):

The example

Flag rows where dividing would fail.

ABC
1UnitsHoursStatus
21208OK
3900Check input
4755OK

The formula

The status in C2:

=IF(ISERROR(A2/B2), "Check input", "OK") // 90/0 errors → Check input

How it works

ISERROR turns an error into a testable TRUE/FALSE:

  1. It evaluates the inner expression A2/B2.
  2. If the result is any error type (#DIV/0!, #N/A, #VALUE!…), ISERROR returns TRUE.
  3. IF then returns your label — “Check input” — instead of letting the error show.
  4. Use ISNA to catch only #N/A (a missing lookup) while letting real bugs surface.

ISERROR (test) vs IFERROR (replace). ISERROR just answers “is it an error?” — use it to count or branch. IFERROR replaces the error with a fallback in one step — use it when you just want clean output.

Try it: interactive demo

Live demo

Change the hours (try 0); see the error check.

ISERROR:   Status:

Variations

Catch only #N/A

ISNA ignores other errors:

=IF(ISNA(VLOOKUP(E2,A:B,2,0)), "Not found", "Found")

Count the errors in a range

SUMPRODUCT tallies TRUEs:

=SUMPRODUCT(--ISERROR(C2:C100))

Just hide the error

IFERROR replaces in one step:

=IFERROR(A2/B2, "")

Pitfalls & errors

ISERROR hides everything, including bugs. When you only expect “not found,” use ISNA so genuine errors still show.

ISERROR is a test, not a fix. It returns TRUE/FALSE; to actually replace the error, wrap the formula in IFERROR instead.

ISERR vs ISERROR. The rarely-used ISERR catches all errors except #N/A. Most of the time you want ISERROR.

Practice workbook

📊
Download the free Check if a Cell Has an Error practice workbook
A division example with live ISERROR status, the ISNA, count-errors, and IFERROR variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I check if a cell has an error in Excel?
Use ISERROR inside IF: =IF(ISERROR(formula), "error", "ok"). ISERROR returns TRUE for any error type, so you can flag, count, or branch on it.
What's the difference between ISERROR and IFERROR?
ISERROR tests whether something is an error and returns TRUE/FALSE. IFERROR replaces an error with a fallback value in one step. Use ISERROR to react, IFERROR to clean up.
How do I check only for #N/A errors?
Use ISNA, e.g. =IF(ISNA(VLOOKUP(...)), "Not found", "Found"). It catches only #N/A and lets other errors surface as real problems.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Catch errors with IFERROR · Check if a cell is blank · Check if number or text

Function references: ISERROR · ISNA · IFERROR