ERROR.TYPE

Returns a number corresponding to one of the error values in Microsoft Excel. You can use ERROR.TYPE in an IF function to test for an error value and return a text string instead of the error value.

Syntax

ERROR.TYPE(error_val)

Error_val   is the error value whose identifying number you want to find. Although error_val can be the actual error value, it will usually be a reference to a cell containing a formula that you want to test.

If error_val is

ERROR.TYPE returns

#NULL!

1

#DIV/0!

2

#VALUE!

3

#REF!

4

#NAME?

5

#NUM!

6

#N/A

7

Anything else

#N/A


Example

The following formula checks cell E50 to see whether it contains a #N/A error value. If it does, the text "Value is not available" is displayed. Otherwise, the value in E50 is returned.


IF(ERROR.TYPE(E50)=7, "Value is not available", E50)