ERROR.TYPE (error type)

<< Click to Display Table of Contents >>

ERROR.TYPE (error type)

Syntax:

ERROR.TYPE(Reference)

Description:

Returns a number representing the type of error value in a cell.

Reference is a reference to a single cell.

Possible results of this function:

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 about error values, see Error values.

Example:

If A1 contains 1/0 and A2 contains 1/1. The following applies:

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

ERROR.TYPE(A2) returns #N/A (i.e., no error)

The calculation below returns "Error!" if any kind of error occurs in cell A1, otherwise it returns the contents of A1:

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

See also:

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