ERROR.TYPE (error type)

<< Click to Display Table of Contents >>

ERROR.TYPE (error type)

Syntax:

ERROR.TYPE(Cell)

Description:

This function can be used to query the type of error value in a cell.

As an argument, the function expects the address of the cell to be checked.

The function returns the following results:

Error value in cell

Result

No error value

#N/A

#NULL!

1

#DIV/0!

2

#VALUE!

3

#REF!

4

#NAME?

5

#NUM!

6

#N/A

7

For more information on error values, see Error values.

Example:

Cell A1 contains 1/0 and cell A2 contains 1/1.

Then the following applies:

ERROR.TYPE(A1) returns 2 (thus #DIV/0!)

ERROR.TYPE(A2) returns #N/A (thus no error)

The following formula returns the text "Error!" if any error occurs in cell A1, otherwise the value in A1 is returned.

IF(ISNA(ERROR.TYPE(A1)), A1, "Error!")

See also:

ISERR, ISERROR, ISNA, NA(), IFERROR, IFNA, TYPE, section Error values