From bd002743972148b9a2dca39248e9f0f406c34eea Mon Sep 17 00:00:00 2001 From: tagezi Date: Mon, 12 Oct 2015 19:48:10 +0300 Subject: Added description the ERROR.TYPE function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit func_error_type.xhp is NEW and contains the description maybe, need to add more good examples AllLangHelp_scalc.mk added the link to the file 04060109.xhp added the link to name and description on the function Change-Id: Ic178c3198ffa91bf02dcf611013347ca7814ab30 Reviewed-on: https://gerrit.libreoffice.org/19361 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- AllLangHelp_scalc.mk | 1 + source/text/scalc/01/04060109.xhp | 4 + source/text/scalc/01/func_error_type.xhp | 129 +++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 source/text/scalc/01/func_error_type.xhp diff --git a/AllLangHelp_scalc.mk b/AllLangHelp_scalc.mk index 0c180cab86..09735b862e 100644 --- a/AllLangHelp_scalc.mk +++ b/AllLangHelp_scalc.mk @@ -194,6 +194,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,scalc,\ helpcontent2/source/text/scalc/01/func_eastersunday \ helpcontent2/source/text/scalc/01/func_edate \ helpcontent2/source/text/scalc/01/func_eomonth \ + helpcontent2/source/text/scalc/01/func_error_type \ helpcontent2/source/text/scalc/01/func_hour \ helpcontent2/source/text/scalc/01/func_minute \ helpcontent2/source/text/scalc/01/func_month \ diff --git a/source/text/scalc/01/04060109.xhp b/source/text/scalc/01/04060109.xhp index 0abddba139..aab9735357 100644 --- a/source/text/scalc/01/04060109.xhp +++ b/source/text/scalc/01/04060109.xhp @@ -178,6 +178,10 @@ oldref="44">Example If cell A1 displays Err:518, the function =ERRORTYPE(A1) returns the number 518. +
+ + +
INDEX function diff --git a/source/text/scalc/01/func_error_type.xhp b/source/text/scalc/01/func_error_type.xhp new file mode 100644 index 0000000000..4933739fc9 --- /dev/null +++ b/source/text/scalc/01/func_error_type.xhp @@ -0,0 +1,129 @@ + + + + + + + ERROR.TYPE function + text/scalc/01/func_error_type.xhp + + + + + +
+ + + ERROR.TYPE function + index of the Error type + + +ERROR.TYPE function +Returns a number representing a specific Error type, or the error value #N/A, if there is no error. +
+ +Syntax +ERROR.TYPE(Error_value) +Error_value – required argument. The error value or a reference to a cell, whose value needs to be processed. + + + + + Error value + + + Returns + + + + + Err:511 + + + 1 + + + + + #DIV/0! + + + 2 + + + + + #VALUE! + + + 3 + + + + + #REF! + + + 4 + + + + + #NAME? + + + 5 + + + + + #NUM! + + + 6 + + + + + #N/A + + + 7 + + + + + Anything else + + + #N/A + + +
+ + +Examples +Simple usage +=ERROR.TYPE(#N/A) +Returns 7, because 7 is the index number of the error value #N/A. +=ERROR.TYPE(A3) +If A3 contains an expression equivavlent to the division by zero, the function returns 2, because 2 is the index number of the error value #DIV/0! +More advanced way +If in division A1 by A2, A2 can turn to zero, you can handle the situation as follows: +=IF(ISERROR(A1/A2);IF(ERROR.TYPE(A1/A2)=2;"the denominator can't be equal to zero");A1/A2) +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. +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. +
+ISERROR, NA, IF +Error codes +
+ + +
\ No newline at end of file -- cgit