Name

ERROR.TYPE

Synopsis

Use ERROR.TYPE to return a number that corresponds to one of the error values within Microsoft Excel or #N/A if an error does not exist. This function is typically used in combination with the IF function to check for an error condition and return a specific value instead of the error message.

The function returns either an integer value of 1-7 or #N/A, as outlined in Table 20-1, to indicate the type of error value in the specified reference.

Table 20-1. Excel Error Values

Return Value of ERROR.TYPE

Corresponding Error

1

#NULL!

2

#DIV/0!

3

#VALUE!

4

#REF!

5

#NAME?

6

#NUM!

7

#N/A

#N/A

The cell does not contain an error value

To Calculate

=ERROR.TYPE(Error_Val)
Error_Val

This required argument indicates an error value or a reference to a cell you want checked for an error value.

Example

Figure 20-2 illustrates how to use ERROR.TYPE to determine the type of error contained in a cell within a worksheet. The example illustrates how the function returns a different integer value for each of the error values within Excel and a value of #N/A for any non-error values. The example also shows how ISBLANK, ISERR, ISERROR, and ISNA can be used to determine if a cell contains a specific error value.

Use ERROR.TYPE to determine the type of error value contained in a cell

Figure 20-2. Use ERROR.TYPE to determine the type of error value contained in a cell

Get Excel 2000 in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.