Skip to content

ISERROR

Returns TRUE when a value is any error, including #N/A. Use it to flag, count or branch on errors without changing the result.

Syntax

=ISERROR()

Information

Every version of Excel, including Microsoft 365, Excel 2024, 2021, 2019, 2016 and earlier, Excel for the web and the mobile apps.

Try it

Edit the formula in D2 or change the inputs. The sheet recalculates as you type.

D2
A
B
C
D
E
1
Region
Revenue
Orders
Error?
2
North
48200
0
TRUE
3
South
31750
125
4
5

D2 =ISERROR(B2/C2) returns TRUE

How ISERROR works

ISERROR returns TRUE if a value is an error of any kind and FALSE otherwise. =ISERROR(B2/C2) is TRUE when the division fails and FALSE when it works. It doesn't change the value or hide the error. It just reports whether one exists.

The argument

value is usually a cell or a formula. All the error types count: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? and #NULL!. Numbers, text, logical values and empty cells are FALSE.

ISERROR, ISERR and ISNA

There are three tests, which differ in what they accept:

  • ISERROR is TRUE for every error.
  • ISNA is TRUE for #N/A only.
  • ISERR is TRUE for every error except #N/A.

Together they let you tell "not found" from "broken". A lookup that returns #N/A simply has no match. A lookup that returns #REF! is a faulty formula, and you don't want to treat that the same way.

ISERROR versus IFERROR

Before Excel 2007, handling an error meant repeating the formula: =IF(ISERROR(B2/C2), 0, B2/C2). IFERROR replaced that pattern with =IFERROR(B2/C2, 0), which is shorter and calculates once. Use IFERROR (or IFNA) when you just want a fallback value.

ISERROR is still the right tool when you want a flag or a count instead of a replacement:

  • =ISERROR(B2/C2) in a check column marks rows that fail, so you can filter them.
  • =SUMPRODUCT(--ISERROR(D2:D100)) counts the errors in a range. It is a quick health check for a sheet.
  • =IF(SUMPRODUCT(--ISERROR(D2:D100))>0, "Errors found", "OK") gives one summary cell at the top of a sheet.
  • Conditional formatting rules such as =ISERROR(D2) highlight error cells.

Using ISERROR in a model

A reasonable pattern: leave errors visible in the working sheets, so you notice them, and add a single check cell on a summary sheet that counts them with ISERROR. A wall of IFERROR wrappers hides problems instead of showing them.

Working with ranges

In Microsoft 365 and Excel 2021 or later, =ISERROR(D2:D100) returns an array of TRUE and FALSE values. =FILTER(A2:D100, ISERROR(D2:D100)) lists the rows that have an error. In older versions, use it inside SUMPRODUCT as above, which handles the array for you.

What ISERROR doesn't do

It doesn't tell you which error you have. If you need the type, use ERROR.TYPE, or the individual tests ISNA and ISERR. And it doesn't stop an error from spreading: any formula that reads an error cell also returns the error until you handle it.

Arguments

value
The value, cell or formula to check, such as B2/C2 or VLOOKUP(...). ISERROR is TRUE for #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? and #NULL!, and FALSE for everything else.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Flag a failing division

D2 =ISERROR(B2/C2)

Result: TRUE

B2/C2 divides by zero and gives #DIV/0!, so ISERROR is TRUE. For South the division works and the result would be FALSE.

D2
A
B
C
D
E
1
Region
Revenue
Orders
Error?
2
North
48200
0
TRUE
3
South
31750
125
4
5

D2 =ISERROR(B2/C2) returns TRUE

Example 2

A lookup that finds nothing

B6 =ISERROR(VLOOKUP(A6,A2:B3,2,FALSE))

Result: TRUE

SKU-300 isn't in the list, so VLOOKUP returns #N/A and ISERROR reports TRUE. ISERROR can't tell a not-found #N/A from a #REF!, but ISNA can.

B6
A
B
C
D
1
SKU
Price
2
SKU-101
39
3
SKU-102
89
4
5
Find
Error?
6
SKU-300
TRUE
7

B6 =ISERROR(VLOOKUP(A6,A2:B3,2,FALSE)) returns TRUE

Example 3

Count the errors in a column

C2 =SUMPRODUCT(--ISERROR(A2:A6))

Result: 2

ISERROR checks each cell of A2:A6, the double minus turns TRUE and FALSE into 1 and 0, and SUMPRODUCT adds them. A3 and A5 divide by zero, so the count is 2.

C2
A
B
C
D
1
Revenue per order
Errors
2
385
2
3
#DIV/0!
4
462
5
#DIV/0!
6
498
7
8

C2 =SUMPRODUCT(--ISERROR(A2:A6)) returns 2

Example 4

ISERR ignores #N/A

B2 =ISERR(A2)

Result: FALSE

A2 holds #N/A, so ISERROR(A2) would be TRUE, but ISERR is FALSE because it excludes #N/A. ISNA(A2) would be TRUE.

B2
A
B
C
D
1
Lookup result
ISERR
2
#N/A
FALSE
3
4

B2 =ISERR(A2) returns FALSE

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In E2, return Check when the revenue per order in column D is an error, and OK when it is a number. Fill down to E5.

Answer in E2, then it fills down to E5.

E2
A
B
C
D
E
F
1
Region
Revenue
Orders
Per order
Check
2
North
48,200
0
#DIV/0!
3
South
31,750
125
254.00
4
East
42,900
210
204.29
5
West
37,400
0
#DIV/0!
6
7
Rows with errors
8
9
10

Common mistakes

  • ISERROR treats #N/A like any other error. If "not found" is expected and anything else is a problem, use ISNA or IFNA instead.
  • Wrapping a long formula in IF(ISERROR(x), 0, x) calculates it twice. IFERROR does the same job in one pass.
  • ISERROR only reports the error. The cell it reads still shows the error, and any formula that depends on that cell still returns an error.
  • Hiding every error with a wrapper makes it easy to miss a broken formula. Count errors on a summary sheet instead.
  • ISERROR is FALSE for a cell that holds the text "#N/A". Only a real error value counts.

Questions people ask

What is the difference between ISERROR and IFERROR?

ISERROR returns TRUE or FALSE and leaves the value alone. IFERROR returns a replacement value when there is an error. Use ISERROR for flags and counts, and IFERROR for fallback values.

What is the difference between ISERROR, ISERR and ISNA?

ISERROR is TRUE for every error. ISNA is TRUE only for #N/A. ISERR is TRUE for every error except #N/A.

How do I count errors in a range?

Use `=SUMPRODUCT(--ISERROR(A2:A100))`. It checks each cell and adds the TRUE results.

How do I highlight cells with errors?

Select the range, choose Conditional Formatting > New Rule > Use a formula, and enter `=ISERROR(A2)` for the top-left cell of the selection.

Learn ISERROR in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.