---
title: "Creating and Configuring Formulas"
description: "Controlling indicators such as the absolute liquidity ratio, the equity ratio, and the return on sales can be created in Lucanet using formulas. Formulas can be used in all ledgers and schedules to calculate any values."
source_url: https://support.lucanet.cloud/en/documentation/consolidation-financial-planning/report-analyze/elements-ledgers-schedules/create-configure-formulas
language: en
last_updated: 2023-08-16
---
# Creating and Configuring Formulas

### Overview

Controlling indicators such as the absolute liquidity ratio, the equity ratio, and the return on sales can be created in Lucanet using [formulas](https://support.lucanet.cloud/en/documentation/glossary.md#formula). Formulas can be used in all [ledgers](https://support.lucanet.cloud/en/documentation/glossary.md#ledger) and [schedules](https://support.lucanet.cloud/en/documentation/glossary.md#schedule) to calculate any values. A formula comprises **variables** and mathematical **operators**. Each variable of a formula can apply to an [item](https://support.lucanet.cloud/en/documentation/glossary.md#item), an [account](https://support.lucanet.cloud/en/documentation/glossary.md#account), a different formula, a time series, or a total line in the Lucanet database.

## Variables and Operators in Formulas

The following variables and operators can be used in formulas:

#### Variables

The variables of a formula can be an item, an account, a different formula, a time series, or a total line. Variables can be named arbitrarily.

#### Operators

The following operators can be used in a formula:

= > < <\> >= <= ( ) AND OR IF + - / \* LM LAST_MONTH

How to use **IF**, **LM** and **LASTMONTH** is described in detail in _Special formulas_.

## Creating and Configuring a Formula

How to create and configure a formula is described in the following section. Alternatively, you can find the information in the following video:

You have to enable marketing cookies to play this Vimeo video.

### Creating Formulas

To create a formula:

{% stepper %}
{% stepper-step %}
Open the ledger ([general ledger](https://support.lucanet.cloud/en/documentation/glossary.md#general-ledger), [subledger](https://support.lucanet.cloud/en/documentation/glossary.md#subledger), or [statistical ledger](https://support.lucanet.cloud/en/documentation/glossary.md#statistical-ledger)) and navigate to the item where you want to create the formula.
{% /stepper-step %}
{% stepper-step %}
Right-click the item and choose **Create | Formula** from the context menu.

Creating a formula

{% /stepper-step %}
{% /stepper %}
### Configuring Formulas

The following options are available in the **Create formula** dialog:

### General

Dialog 'Create formula' - 'General' tab

### Description

**Type**

Element type

**Name**

Name of the formula

**Formula**

Variables, operators, and, if necessary, values of the formula. The entered variables are transferred to the following table.

**Formatting**

Formatting options for display:

**Font color, background color, icon** and if the element is to be formatted bold.

The table contains the configuration of the variables:

## Variable

All variables entered in the **Formula** field are automatically transferred to this column.

## Elements

Elements that represent the variables. Possible elements are items, accounts, time series, total lines, and formulas.

## Transaction type

Transaction type to be used for the calculation

## Period type

The period type of the chosen account or chosen item is preset by default. The following options are available:

- Start balance of the period: The balance at the beginning of the period is used.
- End balance of the period: The balance at the end of the period is used.
- Transaction figure of the period: The transaction figure of the period is used.
- Transaction/balance mode set by user
 - If the button **Display transaction figures** is activated, the transaction figure of the period is used.
 - If the button **Display transaction figures** is deactivated, the balance at the end of the period is used.

## Year-to-date

Year-to-date value from that the calculation is to be made up to the current period. Otherwise the value will be calculated for the current period.

### Value type

Dialog 'Create formula' - 'Value type' tab

### Description

**Value type**

Specification of the value type for the output value of the formula. The following options are available:

- **Number**:The output value is displayed as a number.
- **Percent values**: The output value is displayed as a percentage value.
- **Checksum**: The output value is displayed as a checksum.\
\
The checksum in the event of a successful check must be **0**. In this case the output value is displayed in green. Otherwise, the value is displayed in red:

Display of checksums

**Decimal places**

Specification of the decimal places for the output value of the formula. The following options are available:

- **Dependent on variable**: The display of the decimal places is taken over by the variable.\
\
**Note**: This value is available only for the **Number** and **Checksum** value types.
- **User-defined**: Enter the number of decimal places in the displayed input field.

### Number format

Dialog 'Create formula' - 'Number format' tab

{% warning-box %}
The **Number format** tab is only displayed for formulas in statistical ledgers.
{% /warning-box %}

### Description

On the **Number format** tab, the way numbers are displayed for a formula can be configured. The following options are available:

**Apply number format**

Applies the number format that is different from the display settings

**Number display**

Formatting of the displayed values

**Decimal places**

Number of displayed decimal places

{% warning-box %}
Configurations on the **Number format** tab overwrite the number format defined in the [display settings](https://support.lucanet.cloud/en/documentation/consolidation-financial-planning/report-analyze/display-ledgers-schedules/configure-display-settings.md).

As soon as a deviating number format has been configured, the icon is displayed in the row of the formula.
{% /warning-box %}

### Attributes

Attributes

### Description

**Attributes** are used to define multilingual or customer-specific names for Lucanet elements.

The **Attributes** tab displays all attributes that have been defined in the [Attributes](https://support.lucanet.cloud/en/documentation/consolidation-financial-planning/basic-configuration-cfp/configuring-attributes.md) workspace and are enabled for this dimension.

You can edit the value of an attribute by opening the element's edit mode and clicking on the corresponding row in the **Value** column.

## Special Formulas

### LM and LAST MONTH

With **LM** or **LAST_MONTH**, previous period values can be considered in a cumulative form (e. g. the last six months). The general structure of a formula with **LM** or **LAST_MONTH** is as follows:

```
LM(number of months;a) or

```

```
LAST_MONTH (number of months;a)

```

{% idea-box %}
**Example 1**

Calculation of the revenue of the last six months, with the variable a standing for the revenue item. In this case, the formula is as follows:

LM(6;a)
{% /idea-box %}

### IF formula

An **IF formula** can be used, for example, to calculate interest if a different interest rate is to be applied to positive than to negative balances on the account. The general structure of an **IF formula** is as follows:

IF(condition;then value;else value)

{% idea-box %}
**Example 1**

In the following formula, b is output if a = 10 applies. C is output in the event of any other value:

IF (a=10;b;c)

**Example 2**

In the following formula, b is output if a is smaller than 10 or a is greater than d. C is output if both conditions do not apply:

IF (a<10 OR a>d;b;c)

**Example 3**

The following video shows the development of a formula for the interest:

You have to enable marketing cookies to play this Vimeo video.
{% /idea-box %}
