ERROR.TYPE Function
Returns a number that identifies which error a value is.
Category
Information
Available in
All versions, Microsoft 365
Returns
A number for the error type, or #N/A
Overview
ERROR.TYPE turns an error into a code: 1 #NULL!, 2 #DIV/0!, 3 #VALUE!, 4 #REF!, 5 #NAME?, 6 #NUM!, 7 #N/A — and in Microsoft 365, 8 #GETTING_DATA, 9 #SPILL!, 13 #FIELD! and 14 #CALC!.
If the value isn't an error at all, ERROR.TYPE itself returns #N/A. Use it to show a friendly explanation for each kind of error.
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| error_val | Yes | The value, cell or formula to identify. |
Examples
Example 1 — Identify each error
Column A holds formulas that went wrong — and one that didn't.
| A | B | |
|---|---|---|
| 1 | Result | Code |
| 2 | #DIV/0! | 2 |
| 3 | #VALUE! | 3 |
| 4 | #NUM! | 6 |
| 5 | #N/A | 7 |
| 6 | 125 | #N/A |
Example 2 — Friendly error messages
Explain what went wrong in plain words. Check ISERROR first, because ERROR.TYPE returns #N/A for normal values.
| A | B | |
|---|---|---|
| 1 | Result | Message |
| 2 | #DIV/0! | Divide by zero |
| 3 | #N/A | Not found |
| 4 | 125 | OK |
Common mistakes
- #N/A when there's no error. That's how ERROR.TYPE says “not an error”. Wrap it in ISERROR or IFERROR.
Notes

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.