You can add a version formula to a model. The version formula applies to the whole model, wherever the Versions dimension is applied. You would typically use a version formula for variance calculations.

To add a version formula to a model:

- In the model settings
**Versions**. - In the
**Formula**cell for the version, type the formula. The formula applies to number-formatted line items only. Line items with other types of formatting are left blank.

In the example below, formulas calculate the*Variance*, and the*Variance %*.

Actual | Switchover | Formula | |

Actual | Yes | ||

Budget | |||

Variance | Actual - Budget | ||

Variance % | `IF Budget > 0 THEN 100 * (Actual - Budget) / Budget ELSE 100 * (Budget - Actual) / Budget` | ||

Forecast | `Apr 14` |

If the formula is incorrect a warning message is displayed. Check line item names are entered correctly, and the correct syntax is used for the formula. Learn more in IF THEN ELSE and Operators and Constants.