> ## 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.

# Common formula patterns

> Reuse common Oculon formula patterns for planning, allocation, and model maintenance.

Most planning models reuse the same formula shapes. When you standardize those shapes, you make the model easier to build, review, and hand off to another planner.

## Actual-to-planned switch

This is one of the most important patterns in Oculon.

Use it when the variable should behave one way for closed periods and another way for forecast periods.

```text theme={null}
if timestep <= lastActualDate then Actual revenue else Price * Volume
```

Tie the switch to the [`Last actual date`](https://oculon.mintlify.site/docs-new/time/last-actual-date), not to a hard-coded month.

## Driver-based formulas

Driver-based formulas turn a small set of assumptions into a reusable output.

Common examples include:

* `Revenue = Price * Volume`
* `Payroll tax = Headcount cost * Tax rate`
* `Marketing spend = Pipeline target * Spend ratio`

These formulas work best when each input variable has a clear business name.

## Headcount logic

Headcount formulas often use conditional logic to identify active periods.

```text theme={null}
if timestep >= Start date and (timestep <= End date or End date = blank) then 1 else 0
```

This pattern is useful when you need monthly active headcount, hiring plans, or employee-based allocations.

## Seasonality with relative time

Seasonality usually depends on time context, not on one fixed date.

```text theme={null}
if month in [11, 12, 1, 2] then Base demand * Winter factor else Base demand
```

Use [Relative time](https://oculon.mintlify.site/docs-new/time/relative-time.md) and time helpers when the pattern should still work after each close.

## Cohort-based patterns

Cohort logic is easier to maintain when you keep each part of the pattern separate:

* acquisition or starting population
* retention or decay logic
* expansion or revenue logic

Do not force all of that into one formula. Use helper variables so each step stays reviewable.

## Simple allocations

Allocation formulas distribute one total across dimension values using a share or driver.

```text theme={null}
Allocated overhead = Total overhead * Allocation share
```

This works best when:

* the source total is clearly owned
* the allocation share is reviewed separately
* you check the result at both detail and total level

## Pattern discipline matters

The formula does not need to look identical in every model, but the intent should stay recognizable. If your team uses the same pattern for revenue builds, staffing plans, and allocations, reviews move much faster.

## Related pages

* [Formula basics](https://oculon.mintlify.site/docs-new/formulas/formula-basics.md)
* [Conditional logic](https://oculon.mintlify.site/docs-new/formulas/conditional-logic)
* [Helper variables and modifiers](https://oculon.mintlify.site/docs-new/formulas/helper-variables-and-modifiers.md)
* [Formula best practices](https://oculon.mintlify.site/docs-new/formulas/formula-best-practices.md)


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