The IFNAN function checks for error and returns the default value if the value in the node is an error.
Syntax
IFNAN(value1, value2?: number) - > number
Arguments
Arguments
Data type
Description
value1
Number,Node reference
The node that is to be checked for error values.
value2?: number
Number,Node reference
The value that should replace the errors. The value should be of numerical datatype only.
Return Value
value2 in the place of Error.
Example
Consider the nodes Total Cost and No. of units to have the periods values as shown below:
Now, Cost per unit is calculated by dividing the Total Cost by No. of units. If IFNAN is not applied, the result would be as follows due to 'divide by zero' error:
Before applying IFNAN
The error is to be replaced with 0. To achieve this, the following formula should be written in the [Cost Per Unit] node: