> ## Documentation Index
> Fetch the complete documentation index at: https://oculon.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Learn what formulas do in Oculon and how they behave across time, dimensions, and model context.

Formulas tell Oculon how a variable should calculate. They connect inputs, assumptions, and business rules so the model can update results consistently across time and dimension context.

## Why formulas matter

Formulas let you:

* turn manual inputs into reusable logic
* reference other variables instead of duplicating values
* react to time, dimensions, and aggregation context
* separate historical behavior from forward-looking planning logic
* feed consistent outputs into views, boards, and scenarios

## Where formulas live

In Oculon, formulas usually live on variables inside a model. A variable can hold entered values, calculated values, or a mix of both depending on how you set it up.

This is why formulas are part of model structure, not just reporting. If a core variable changes, the formulas that depend on it can change downstream outputs across the model.

## Actual formula versus planned formula

Most planning models need different logic on each side of the cutoff.

* The `actual formula` applies to periods up to and including the [`Last actual date`](https://oculon.mintlify.site/concepts/data-and-structure/time/last-actual-date).
* The `planned formula` applies to periods after that cutoff.
* Both formulas belong to the same variable, but they can behave differently when the model moves from closed periods into forecast periods.

This split keeps historical logic clear and makes forecast logic easier to review during each close cycle.

## The three building blocks of formulas

Every formula is usually made from three core parts:

### Operators

Operators handle arithmetic and comparisons such as `+`, `-`, `*`, `/`, `=`, `!=`, `>`, and `<`.

### Functions

Functions help you express repeated logic more clearly. Common examples include conditional logic, rounding, sums, and averages. See [Functions](https://oculon.mintlify.site/concepts/modeling/formulas/functions.md) for the main categories.

### References

References connect one variable to another. Good references keep formulas readable and reduce duplicate logic. See [Variable references](https://oculon.mintlify.site/concepts/data-and-structure/variables/variable-references.md) for reference patterns and review tips.

## Formula context matters

The same formula can return a different result depending on the context where Oculon evaluates it.

Common context shifts include:

* the active time period
* the current dimension value
* whether the model is on the actuals side or planned side of the cutoff
* whether the result is being reviewed at detail level or summary level

This is why a formula that looks correct in one row or month can still behave unexpectedly in a board or summary view.

## Start with simple formulas

Use the clearest version of the business rule first. If the logic starts to branch across time, dimensions, or conditions, split it into helper variables instead of building one long expression.

```text theme={null}
Revenue = Price * Volume
Gross margin = Revenue - Cost of sales
if timestep <= lastActualDate then Actual revenue else Price * Volume
```

![Q4 Revenue Planning Model with the formula editor open on Beginning ARR in the Revenue Calculations section. The editor has Actual and Plan tabs, with Plan selected, and shows the formula IF(PERIOD() = 0, Opening ARR This month, Ending ARR by Location Previous Month).](https://mintcdn.com/oculon/1JWHwlExES5W7YSl/images/start-here/variable-overview.png?fit=max\&auto=format\&n=1JWHwlExES5W7YSl\&q=85\&s=cc55cd06874d9d40a078de292a499148)

Actual and planned formulas on a variable

Most planning models use both an **actual formula** and a **planned formula**, split by the [Last actual date](https://oculon.mintlify.site/concepts/data-and-structure/time/last-actual-date.md).

## In this section

> [card] [Formula editor](https://oculon.mintlify.site/concepts/modeling/formulas/formula-editor.md)
>
> Write and review formulas on the source variable.

> [card] [Functions](https://oculon.mintlify.site/concepts/modeling/formulas/functions.md)
>
> Operators, logical branches, and math helpers.

> [card] [Conditional logic](https://oculon.mintlify.site/concepts/modeling/formulas/conditional-logic.md)
>
> Branch formulas for cutoffs, seasonality, and exceptions.

> [card] [Helper variables and modifiers](https://oculon.mintlify.site/concepts/modeling/formulas/helper-variables-and-modifiers.md)
>
> Keep formulas readable with helpers and time context.

> [card] [Common formula patterns](https://oculon.mintlify.site/concepts/modeling/formulas/common-formula-patterns.md)
>
> Reusable patterns for planning and allocation.

> [card] [Formula errors](https://oculon.mintlify.site/concepts/modeling/formulas/formula-errors.md)
>
> Diagnose wrong numbers, blanks, and cutoff mistakes.

> [card] [Formula best practices](https://oculon.mintlify.site/concepts/modeling/formulas/formula-best-practices.md)
>
> Habits that keep formulas reviewable and stable.

## Related pages

* [Variable references](https://oculon.mintlify.site/concepts/data-and-structure/variables/variable-references.md)
* [Time in Oculon](https://oculon.mintlify.site/concepts/data-and-structure/time/overview.md)
* [Last actual date](https://oculon.mintlify.site/concepts/data-and-structure/time/last-actual-date.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.