Formualizer Docs

ERROR.TYPE

Returns the numeric code for a specific error value.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=ERROR.TYPE(error_val)

Arguments

ArgumentTypeRequiredDefault
error_valanyRequired—

Return type

Number

Remarks

  • Standard mappings include: #NULL!=1, #DIV/0!=2, #VALUE!=3, #REF!=4, #NAME?=5, #NUM!=6, #N/A=7.
  • Additional internal error kinds may map to extended non-standard codes.

Error cases

  • Non-error inputs return #N/A.

Examples

Identify the error code produced by division by zero.

Formula =ERROR.TYPE(1/0)

Expected result 2

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Identify the code for a missing value instead.

Formula =ERROR.TYPE(NA())

Expected result 7

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Identify a numeric domain error at the square-root boundary.

Formula =ERROR.TYPE(SQRT(-1))

Expected result 6

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A number has no spreadsheet error code.

Formula =ERROR.TYPE(0)

Expected result #N/A

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Non-error input returns N/A

Formula =ERROR.TYPE(10)

Expected result #N/A

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

What if the input is not an error value?

ERROR.TYPE returns #N/A when the input is not an error.

Implementation

Engine source

On this page