# Excel ERROR.TYPE Function

The Excel ERROR.TYPE function returns a number that corresponds to a specific error value. You can use ERROR.TYPE to test for specific kinds of errors. If no error exists, ERROR.TYPE returns #N/A. See below for a key to the error codes returned by ERROR.TYPE.

**error_val**- The error for which to get an error code.

Use ERROR.TYPE to get a number that corresponds to a specific error value. See below for a key to the error codes returned by ERROR.TYPE. If no error exists, ERROR.TYPE returns #N/A.

In most cases, error_val will be supplied as a reference to a cell that may contain an error value.

One way to use ERROR.TYPE is to test for specific errors and display a relevant message (instead of error values) when certain error conditions exist.

Error code key:

1 = #NULL!

2 = #DIV/0!

3 = #VALUE!

4 = #REF!

5 = #NAME?

6 = #NUM!

7 = #N/A

8 = #GETTING_DATA

#N/A =