Contact

ERROR.TYPE in Excel: Classify Errors Without Hiding Them

Information Intermediate Microsoft Excel

Map documented Excel errors to numeric codes, guard error-free cells and build a row-level diagnostic report with clear unmapped-error handling.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: ERROR.TYPE identifies a documented error class by number. =ERROR.TYPE(1/0) returns 2. An ordinary error-free value does not return zero: =ERROR.TYPE(12) returns #N/A.

Availability and version history

  • Introduced: first introduction version is not established by the official history reviewed; the current product list is not a launch record.
  • Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
  • Checked: October 14, 2026; official ERROR.TYPE reference. Documentation and independently modeled examples; no native Excel execution or broader platform certification.

Syntax and documented error codes

=ERROR.TYPE(error_val)

The required argument is commonly a reference to the formula result being inspected. Microsoft’s current dedicated table gives these mappings:

Actual error value Code
#NULL! 1
#DIV/0! 2
#VALUE! 3
#REF! 4
#NAME? 5
#NUM! 6
#N/A 7
#GETTING_DATA 8

These are actual error values, not quoted labels. The dedicated reference does not map newer error families in this table, so this guide does not invent codes for #SPILL!, #CALC! or other unlisted errors.

Example 1: create a diagnostic dataset

Enter these formulas in A2:A7. In B2 use =ERROR.TYPE(A2) and fill down.

Cell Formula in A Result in A Expected ERROR.TYPE
A2 =8/0 #DIV/0! 2
A3 =NA() #N/A 7
A4 =VALUE("x") #VALUE! 3
A5 =12/0 #DIV/0! 2
A6 =8/2 4 #N/A
A7 ="#N/A" text #N/A #N/A

The final two results show why a raw ERROR.TYPE column is not yet a clean report. Both a normal number and text outside the error mapping lead to #N/A in the classifier. That generated #N/A must not be mistaken for evidence that the source cell itself contained the #N/A error.

For an additional error-class control, =ERROR.TYPE(SQRT(-1)) returns 6 because the square root expression produces the documented #NUM! kind of error.

Example 2: keep the source error separate from the code

Replace the formula in B2 with this guarded version and fill down:

=IFERROR(ERROR.TYPE(A2),0)

The six codes are now 2, 7, 3, 2, 0, 0. Zero is an editor-chosen reporting sentinel, not a native ERROR.TYPE success code. By itself, it also cannot distinguish an error-free value from an error that the classifier cannot map.

In C2 use this more explicit label and fill down:

=IF(ISERROR(A2),IF(B2=0,"Unmapped error",IF(B2=2,"Check divisor",IF(B2=7,"Check missing value","Other mapped error"))),"OK")

Expected labels are Check divisor, Check missing value, Other mapped error, Check divisor, OK, OK. The separate ISERROR test prevents the two error-free values from being mislabeled merely because raw ERROR.TYPE would itself return #N/A.

“Unmapped error” is a defensive reporting state. Its presence does not claim that every modern error’s precise native interaction has been tested here.

Example 3: summarize diagnostics without replacing source values

On the guarded B2:B7 code column:

=COUNTIF(B2:B7,2)
=COUNTIF(B2:B7,7)
=COUNTIF(B2:B7,3)
=COUNTIF(B2:B7,0)

Expected counts are 2, 1, 1, 2. There are four actual error rows in this controlled dataset and two error-free rows. Use the original A column and the C labels for investigation; do not replace the failed arithmetic results with their numeric error codes and then include those codes in a business total.

Likewise, code 7 says an actual #N/A reached the expression. It does not establish why: a missing lookup key, an explicit NA formula and a matched source error can share that same class.

Use ISERROR for a yes/no error check, ISNA for a specific #N/A check, and IFERROR for an intentional fallback. ERROR.TYPE is useful when a report needs a finer documented class, but the class is not a root-cause diagnosis.

The examples model documented scalar behavior; transient external data states and newer error classes remain outside native validation.

References and verification

The datasets are fictional. Expected results follow the cited rules and independent arithmetic or type models; they are not native application captures. Examples use English function names and comma argument separators.