Logical
ISERROR
Definition
ISERROR returns TRUE when its argument is any error value, and FALSE otherwise.
Syntax
=ISERROR(value)
Arguments
| Argument | Meaning |
|---|---|
value |
The formula or cell to test, such as a divide. |
Worked example
A mill divides bags packed by hours worked. Bags are in A2:A4 and hours are in B2:B4.
| A: Bags | B: Hours |
|---|---|
| 15 | 0 |
| 9 | 3 |
| 6 | 2 |
Formula: =IF(ISERROR(A2/B2),"stop","ok")
Result: stop. 15 divided by 0 is #DIV/0!, so ISERROR is true and IF returns stop. Filled down, the formula gives stop, ok, and ok.
Practice
Cell A2 holds 10 and cell B2 holds 0. In C2, write a formula that returns 1 when A2 divided by B2 is an error, and 0 otherwise.
- In C2, write an IF formula that uses ISERROR and shows 1 when A2 divided by B2 is an error, and 0 otherwise.
- C2 should show the result for 10 divided by 0.
Related functions
IF converts the TRUE or FALSE from ISERROR into 1 or 0. ISNUMBER tests a different property of the same cell.
Common mistake
Treating every TRUE as a divide by zero: a mistyped range is also an error, so the flag can hide a different mistake.