ID EN
#Information

ERROR.TYPE

Excel Functions

Test for a specific error value

Syntax

EXCEL
=ERROR.TYPE(error_val)

Arguments

Parameter Description
error_val The error for which to get an error code.

Return Value

An error number or #N/A if no error.

Details

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 the table below for a key to the error codes returned by ERROR.TYPE. The ERROR.TYPE function takes just one argument, error_val, which is expected to be an Excel error like #VALUE!, #DIV/0!, #NAME!, etc. When error_val is an error, ERROR.TYPE returns a numeric code. If error_val is not an error, ERROR.TYPE returns an error itself: the #N/A error. In most cases, error_val will be supplied as a reference to a cell that may contain an error value. If cell A1 contains displays the #DIV/0 error, then ERROR.TYPE will return 2: If cell A1 displays the #N/A error, ERROR.TYPE returns 7 If cell A1 disp

Examples

Examples

If cell A1 contains displays the #DIV/0 error, then ERROR.TYPE will return 2:

EXCEL
=ERROR.TYPE(A1) // returns 2
Examples

If cell A1 displays the #N/A error, ERROR.TYPE returns 7

EXCEL
=ERROR.TYPE(A1) // returns 7
Examples

If cell A1 displays no error, ERROR.TYPE returns #N/A

EXCEL
=ERROR.TYPE(A1) // returns #N/A
Examples

One way to use ERROR.TYPE is to test for specific errors and display a custom message when certain error conditions exist. For example, to test for a

EXCEL
=IF(ISERROR(A1),IF(ERROR.TYPE(A1)=2,"Missing value",A1),"")