ERROR.TYPE in Google Sheets: Classify Worksheet Errors
Map Google Sheets errors to documented codes, guard ordinary values and summarize error classes without replacing failed measurements with numbers.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: ERROR.TYPE returns a number for a supplied error. =ERROR.TYPE(NA()) gives 7. Google’s code 8 means other error types, so do not substitute an Excel-specific eighth-code label for this Sheets category.
Availability and version history
- Introduced: first introduction date is not established by the official history reviewed; no desktop release number is inferred.
- Availability: documented in the rolling Google Sheets service; these examples use the web worksheet workflow.
- Checked: October 14, 2026; official ERROR.TYPE reference. Documentation and independent models, with no native Google Sheets execution or wider client certification.
Syntax and documented mappings
=ERROR.TYPE(reference)
The argument can refer to a cell with an error or supply an error expression directly. Google lists:
| Error | Code |
|---|---|
| #NULL! | 1 |
| #DIV/0! | 2 |
| #VALUE! | 3 |
| #REF! | 4 |
| #NAME? | 5 |
| #NUM! | 6 |
| #N/A | 7 |
| Other errors | 8 |
The dedicated text does not explicitly establish what an error-free argument returns. The practical report below tests ISERROR first rather than borrowing another spreadsheet’s no-error behavior.
Example 1: inspect a pair of known errors
Put =9/0 in A2 and =NA() in A3. Use:
=ERROR.TYPE(A2)
=ERROR.TYPE(A3)
Expected codes are 2 and 7. The division has no valid numeric result; the explicit NA expression creates the unavailable-value error. These numbers classify the errors rather than repairing the calculations.
The text expression ="#N/A" is not an actual #N/A error. Use a genuine error-producing expression when building the control instead of typing an error label as ordinary text.
Example 2: a guarded row-level code report
Enter this complete A2:A7 dataset:
| Cell | Formula | Meaning |
|---|---|---|
| A2 | =9/0 |
Division error |
| A3 | =NA() |
Unavailable-value error |
| A4 | =12/3 |
Numeric result 4 |
| A5 | ="#N/A" |
Text, not an error |
| A6 | =6/0 |
Division error |
| A7 | =NA() |
Unavailable-value error |
In B2 use and fill:
=IF(ISERROR(A2),ERROR.TYPE(A2),0)
Expected codes are 2,7,0,0,2,7. Zero is the report’s deliberately chosen sentinel for an error-free source; it is not stated as a native ERROR.TYPE return value. The conditional keeps the unneeded no-error call out of these scalar controls.
In C2 use =IF(B2=0,"OK",IF(B2=2,"Check divisor",IF(B2=7,"Unavailable value","Other error class"))) and fill down. Expected labels are Check divisor, Unavailable value, OK, OK, Check divisor, Unavailable value.
Example 3: summarize classes without losing source evidence
For B2:B7:
=COUNTIF(B2:B7,2)
=COUNTIF(B2:B7,7)
=COUNTIF(B2:B7,0)
Expected counts are 2,2,2. There are four error rows and two error-free rows in the defined fixture. Retain the original formulas beside the report so a reader can inspect which calculation produced each code.
A code column should not replace a measurement column in a business total. Adding codes 2 and 7 would not recover the missing measurements; it would add arbitrary category identifiers.
Example 4: recognize the limit of a class diagnosis
The two NA() rows both have code 7. In a real worksheet, an absent lookup key or a matched source cell containing #N/A could also lead to that class. ERROR.TYPE alone cannot prove which cause occurred.
Similarly, code 2 says a division-related error reached the expression, not which denominator is wrong in a long nested formula. Inspect the component inputs in helper cells before choosing a fallback. A blanket IFERROR returning zero can make a chart or total look complete while hiding missing data.
Code 8 and other boundaries
Google’s reference groups other errors under code 8. This guide does not create an intentionally malformed formula or certify every transient, array-expansion or newly added error subtype. Treat the documented category as a classification rule, while retaining the actual source error display when debugging.
Use ISERROR for a Boolean check, ISNA for #N/A specifically, and IFERROR only when a chosen fallback is appropriate. The ordinary-value behavior of bare ERROR.TYPE and a complete native error-generation matrix remain explicitly unverified.
References and verification
Examples use fictional inputs, English function names and comma argument separators. Expected outputs are independently modeled from the cited rules, not native Sheets captures. Check the spreadsheet locale when reproducing punctuation-sensitive formulas.