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.
The example
Flag rows where dividing would fail.
| A | B | C | |
|---|---|---|---|
| 1 | Units | Hours | Status |
| 2 | 120 | 8 | OK |
| 3 | 90 | 0 | Check input |
| 4 | 75 | 5 | OK |
The formula
The status in C2:
How it works
ISERROR turns an error into a testable TRUE/FALSE:
- It evaluates the inner expression
A2/B2. - If the result is any error type (
#DIV/0!,#N/A,#VALUE!…), ISERROR returns TRUE. - IF then returns your label — “Check input” — instead of letting the error show.
- Use
ISNAto 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
Change the hours (try 0); see the error check.
Variations
Catch only #N/A
ISNA ignores other errors:
Count the errors in a range
SUMPRODUCT tallies TRUEs:
Just hide the error
IFERROR replaces in one step:
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
Frequently asked questions
How do I check if a cell has an error in Excel?
What's the difference between ISERROR and IFERROR?
How do I check only for #N/A errors?
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