Excel’s ERROR.TYPE() function returns a number corresponding to a specific error value.
1. Syntax
=ERROR.TYPE(error_val)
error_val
can be the actual error value, though it will usually be a reference to a cell containing a formula you want to test.
Returns a number representing the type of error encountered.
If error_val is | ERROR.TYPE returns |
---|---|
#NULL! | 1 |
#DIV/0! | 2 |
#VALUE! | 3 |
#REF! | 4 |
#NAME? | 5 |
#NUM! | 6 |
#N/A | 7 |
#GETTING_DATA | 8 |
Anything else | #N/A |
2. Example
Column A below contains deliberate errors. Column D uses the ERROR.TYPE() function to return the error code. Columns B and C contain the ISERR() and ISERROR() functions respectively as a comparison. Column E looks the error code up in the table to confirm the error.


References:
- Microsoft Support. (no date) ERROR.TYPE function. Available at: https://support.microsoft.com/en-us/office/error-type-function-10958677-7c8d-44f7-ae77-b9a9ee6eefaa (Accessed: 29 May 2024).