Excel functions / Information
ERROR.TYPE function
A number for the kind of error: 2 #DIV/0!, 3 #VALUE!, 4 #REF!, 5 #NAME?, 6 #NUM!, 7 #N/A.
Syntax
=ERROR.TYPE(error_val)
Arguments
error_val: The error, or a cell that may hold one.
When to use it
ERROR.TYPE gives a number for an error: 1 #NULL!, 2 #DIV/0!, 3 #VALUE!, 4 #REF!, 5 #NAME?, 6 #NUM!, 7 #N/A. For anything that is not an error it gives #N/A itself. It is used to show a different message for each kind of error.
Examples
The kind of error
A B C D 1 Sales Units 2 500 0 2 In D2:
=ERROR.TYPE(A2/B2)→ 2A message for each kind
A B C D 1 Sales Units 2 500 0 No units yet In D2:
=IFERROR(CHOOSE(ERROR.TYPE(A2/B2), "", "No units yet", "Not a number"), "OK")→ No units yet
Common mistakes
- Using it on a cell without an error. ERROR.TYPE of a normal value is #N/A, so wrap it in IFERROR or test ISERROR first.
ERROR.TYPE in other languages
Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.
- Czech: CHYBA.TYP
- Danish: FEJLTYPE
- Dutch: TYPE.FOUT
- Finnish: VIRHEEN.LAJI
- French: TYPE.ERREUR
- German: FEHLER.TYP
- Hungarian: HIBA.TÍPUS
- Italian: ERRORE.TIPO
- Norwegian: FEIL.TYPE
- Polish: NR.BŁĘDU
- Portuguese (Brazil): TIPO.ERRO
- Portuguese (Portugal): TIPO.ERRO
- Russian: ТИП.ОШИБКИ
- Spanish: TIPO.DE.ERROR
- Swedish: FEL.TYP
- Turkish: HATA.TİPİ
Try ERROR.TYPE in the playground