- Print
- DarkLight
- PDF

You can add formulas to an account to enable automatic calculation of a Debit or Credit account balance based on selected values. Formulas allow you to perform mathematical operations (addition (+), subtraction (-), division (:), and multiplication (*)) on the selected account balance values to calculate the account value:

Using formulas, you can also calculate the average value of the selected accounts (AVERAGE) or the sum of their balances (SUM):

A recursive updating of account balances based on Formulas is implemented. If there is a chain of dependent formulas, when updating the balance of an account at the bottom of the chain, all balances of dependent formulas in the chain above (upstream) are updated on a graph.

### Adding a Formula

You can independently add different formulas to the Debit and Credit parts of the same account.

To add a formula to an account when selecting an actor, follow these steps:

- Select the actor to which you want to add a formula. Open the actor panel;
- In the actor panel, go to the
**Accounts**tab; - Select the account to which you want to add a formula and open its menu;
- Select
**Add formulas**from the drop-down menu:

You can also add a formula to an account by opening the Account menu in the **Accounts** section and selecting the **Add formulas** menu item.

- The menu for adding formulas will open:

The menu for adding formulas will open. Formulas consist of two main components: the accounts (1) and the operations on them, including the built-in SUM and AVERAGE functions (2).

- To start adding a formula, click on the
**Debit**formula field (if you want the formula result to be deducted from the account balance) or the**Credit**formula field (if you want the formula result to be added to the account balance). Then, add the accounts whose balances you want to use for the formula calculation. To add an account, click the account icon (1) and select the actor to which the account belongs:

You can either select the actor from the drop-down list or enter its name in the field.

- Select the account you want to add from the list of the selected actor's accounts:

- Select the type of account you want to use: debit or credit:

If the selected actor does not have an account, a message will be displayed in the actor selection field:

To use this actor in your formula, add an account to the actor or select another actor that has a linked account.

- After you have selected the actor, account, and account type, they will be displayed in the field as an abbreviation containing the first letters of the selected actor, account, account currency, and account type, along with the current account balance:

The selected account value is used for the formula calculation. To add another account, input the mathematical operator (+,-,:,*) after the abbreviation and start a new sequence by selecting another actor, account, and account type:

- Click the
**Save**button in the formula edit menu to save your formula.

After adding a formula, its result will be automatically updated if any of the account balances used in the calculation change.