IF calculation

The detailed planning If calculation evaluates a condition that you specify and returns one value if the condition is true, and another value if the condition is false.

The IF calculation compares two items that you specify (these can be values, attributes, calculations, or global vectors) and returns a specified value if the condition evaluates as true, and another specified value if the condition evaluates as false. For example:

IF({Years of Service} >= 10, <Year of Service Benefit>, 0)

An If expression is composed of three main parts:

IF(logical_comparison, value_if_true, value_if_false)

The logical comparison or test is composed of a logical operator and two values that can evaluate to True or False. As you define the parameters, the resulting calculation appears below the parameters, beside Expression=.

 Note:  Do not nest IF calculations (if you put an IF calculation inside another IF calculation, you will receive an error).

Parameters

  • IF: The first of the two values (operands) to compare. Select Value to enter a numeric value; selecting any of the others presents a list of the currently defined objects of that type. The options are Value (to allow end users to edit the amount, select Adjustable), Attribute, Calculation, Global Vector.
  • is: The logical test can be any of the following operators:
    • = (Equal)
    • =/= (Not Equal)
    • > (Greater Than)
    • >= (Greater Than or Equal)
    • < (Lesser Than)
    • <= (Lesser Than or Equal)
  • The second of the two values (operands) to compare. The options are the same as for IF.
  • then: The result that the If calculation returns if the logical test is true. The options are the same as for IF.
  • if not: The result that the If calculation returns if the logical test is false. The options are the same as for IF.

Example

You can use the IF calculation to apply a benefit expense.

 Example:  If the policy is that if compensation for the month is greater than $3,000, then the employee must pay $100 dental benefit, otherwise the employee must pay $35:

IF(Month_Comp > 3000, 100, 35)

The same expression appears as follows in the Add Calculation dialog: