Description:
This function returns TRUE if the result parameter is an error otherwise FALSE. This will encompass any errors like any divide by zero "#DIV/0" and any "#VALUE" errors. However, The ISERROR function does not work on #NAME errors.
This function should generally be used in conjunction with an IF statement. This function is designed specifically to allow you to check if there exists an error when a specific set of statements are executed. The ISERROR function checks the parameter given as an input and determines if the result of an expression is mathematically appropriate or not. For example : If you wish to calculate certain values based on a formula expression and you want this formula to return a result only if there are no errors encountered or else, you wish to return another specified value instead of an error message, in such a scenario it is possible to use the ISERROR function with an IF condition.
The function takes one parameter, which is the result of any expression. The result can be of any mathematical or logical expression that is returns some value. The expression is first calculated, the result is determined and accordingly if the function determines that an error exists, then it returns "True" otherwise it returns a value "False".
Syntax: ISERROR (Result)
Remarks
Example
=IsError (90/0) |
-returns true if the result of the expression provided to the function is an error. In this case, on dividing 90 because PowerOLAP generates an error, which is "#DIV/0". Therefore the value returned by this function is"True". |
Let us take the example of a cube in PowerOLAP which requires data that is the Boolean value for whether or not an expression's result, is an error value. If in some dimension in some member of a cube, you want to display this accessed Boolean value for the parameter supplied to the function then it is appropriate to use the ISERROR function to access this value. In this case we can write a formula in the cube in PowerOLAP to access this value to check for whether a particular expression's result, actually generates an error, or whether the expression computes successfully. With this function one can write the Boolean value returned to another member that is supposed to hold this value as fact data or you can also write this value to a different dimension or a different member in a different cube.
.png)
The screen above shows a formula for the ISERROR function.
The formula writes a value into the "MetaDataValues" dimension, into the "IsError" member. In the formula, the ISERROR function takes one parameter, which is an expression that returns a resultant value, in this case being "90/0.000".If the expression given to the function returns any error then the function returns a value which is equal to "TRUE", for it implies that an error exists. However if the result of the expression is not an error then the value returned by this function is "False".In the case above, the expression supplied to the function is an expression that is attempting division by "0". Therefore, the result of the expression is an error which is "#DIV/0" and hence the function returns a value which is "True" signifying that an error exists.