Information
ERROR.TYPE Function in Excel
Returns a number corresponding to an error type.
Syntax
- =ERROR.TYPE(error_val)
Arguments
- error_val (required): Error value to identify
Examples
- =ERROR.TYPE(#N/A) - Identify #N/A error - Result: 7
Defensive formulas with ERROR.TYPE
- Use IS* functions inside IF to branch on blank, error, text, or number cells.
- Prefer [IFERROR](/functions/iferror/) when you only need a fallback display value.
- Error hub: [Fix formula errors](/guides/fix-excel-formula-errors/).
Common errors
- #N/A if not an error
Use cases
- Error handling
- Debugging
- Conditional logic
Frequently asked questions
- What are the ERROR.TYPE return values? 1=#NULL!, 2=#DIV/0!, 3=#VALUE!, 4=#REF!, 5=#NAME?, 6=#NUM!, 7=#N/A, 8=#GETTING_DATA, 9=#SPILL!, 10=#CONNECT!, 11=#BLOCKED!, 12=#UNKNOWN!, 13=#FIELD!, 14=#CALC!. Returns #N/A if not an error.
- How do I handle different errors differently? Use ERROR.TYPE with SWITCH or nested IFs: =SWITCH(ERROR.TYPE(A1), 2, "Division by zero", 7, "Not found", "Other error"). This lets you provide specific messages or actions for each error type.
- Why use ERROR.TYPE instead of IFERROR? IFERROR catches all errors the same way. ERROR.TYPE lets you identify which error occurred and handle each differently. Use ERROR.TYPE when you need to distinguish between #N/A (missing data) vs #DIV/0! (calculation error).
Editorial review
- Reviewed by Excel.Directory Editorial Team. Updated May 2026.