mXBjV‖

ksPuq‖ERROR.TYPE function

UMFCu‖Returns a number representing a specific Error type, or the error value #N/A, if there is no error.

tip

jcAXr‖This function is available since LibreOfficeDev 5.0.


ebLBc‖Syntax

YFzz5‖ERROR.TYPE(Error_value)

jxm2V‖Error_value – required argument. The error value or a reference to a cell, whose value needs to be processed.

9FhFw‖Error value

Y9mAa‖Returns

vSzoq‖#NULL! (Err:521)

1

YFSGC‖#DIV/0! (Err:532)

2

DkwY8‖#VALUE! (Err:519)

3

8Ezt4‖#REF! (Err:524)

4

A6cRC‖#NAME? (Err:525)

5

HtBtf‖#NUM! (Err:503)

6

nQMa6‖#N/A (Err:32767)

7

ZB8XE‖Anything else

FySH9‖#N/A


note

RZfPH‖This function is part of the Open Document Format for Office Applications (OpenDocument) standard Version 1.2. (ISO/IEC 26300:2-2015)


GAZG2‖Examples

mCLBE‖Simple usage

oogBc‖=ERROR.TYPE(#N/A)

XYAAM‖Returns 7, because 7 is the index number of the error value #N/A.

MxaAn‖=ERROR.TYPE(A3)

8UJpP‖If A3 contains an expression equivalent to the division by zero, the function returns 2, because 2 is the index number of the error value #DIV/0!

NEmkr‖More advanced way

PP59Q‖If in division A1 by A2, A2 can turn to zero, you can handle the situation as follows:

uvFET‖=IF(ISERROR(A1/A2);IF(ERROR.TYPE(A1/A2)=2;"the denominator can't be equal to zero");A1/A2)

SZAbc‖The ISERROR function returns TRUE or FALSE depending on whether there is an error or not. If the error takes place, the function IF addresses to the second argument, if there is no error, it returns the result of the division. The second argument checks the index number representing the specific Error type, and if it is equal to 2, it returns the specified text "the denominator can't be zero" or 0 otherwise. Thus, clear text would signify the division by zero, the result of the division would appear when the division is successful, or if there is, for example, an error of another type, zero would be returned.

warning

8XdGp‖If the ERROR.TYPE function is used as condition of the IF function and the ERROR.TYPE returns #N/A, the IF function returns #N/A as well. Use ISERROR to avoid it as shown in the example above.



jKnF4‖ISERROR, NA, IF

tEskv‖Error codes