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 =ISERROR(B2/C2) returns TRUE
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()
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 =ISERROR(B2/C2) returns TRUE
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.
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.
There are three tests, which differ in what they accept:
#N/A only.#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.
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.=ISERROR(D2) highlight error cells.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.
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.
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.
B2/C2 or VLOOKUP(...). ISERROR is TRUE for #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? and #NULL!, and FALSE for everything else.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
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 =ISERROR(B2/C2) returns TRUE
Example 2
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 =ISERROR(VLOOKUP(A6,A2:B3,2,FALSE)) returns TRUE
Example 3
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 =SUMPRODUCT(--ISERROR(A2:A6)) returns 2
Example 4
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 =ISERR(A2) returns FALSE
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.
#N/A like any other error. If "not found" is expected and anything else is a problem, use ISNA or IFNA instead.IF(ISERROR(x), 0, x) calculates it twice. IFERROR does the same job in one pass.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.
ISERROR is TRUE for every error. ISNA is TRUE only for #N/A. ISERR is TRUE for every error except #N/A.
Use `=SUMPRODUCT(--ISERROR(A2:A100))`. It checks each cell and adds the TRUE results.
Select the range, choose Conditional Formatting > New Rule > Use a formula, and enter `=ISERROR(A2)` for the top-left cell of the selection.
Tracks take you from the basics to modelling, one graded exercise at a time.