# Custom fields: formula fields

**Note:** This feature is only available on Premium and higher plans.

**Formula fields** help you save time and reduce errors by automating number-based logic in your **deal** items.

You can use them to instantly calculate values such as discounts, commissions or forecast amounts based on **numerical** or **monetary** deal fields.

This is especially useful when you want consistent, real-time results.

**Note:** If you’re looking to evaluate deal potential with weighted criteria instead, check out our article on **[Scores](https://support.pipedrive.com/article/scores)**.

* * *

## Setting up formula fields

**Note:** Each company account can have up to **ten formula fields**.

Open the **account menu** in the right corner and go to **Personal Preferences > [Data fields](https://app.pipedrive.com/settings/fields)**.

In the **lead/deal** section, click **“+ Custom field”** to create a new field.

![](https://kb-cms.pipedriveassets.com/formulasetup.png)

**Note:** Although formula fields are created using **lead** or **deal custom fields**, they only calculate values in **deals**.

**Name** the field and set its **type** to either _monetary_ or _numerical_. Then, enable **“Apply formula to deals”** to add a formula.

![](https://kb-cms.pipedriveassets.com/ff1.png)

### Writing the field formula

Once you switch it on, you’ll see the **field formula** area where you can define the calculation.

![](https://kb-cms.pipedriveassets.com/ff2.png)

You can only use monetary or numerical deal fields as input. By default, you can use the following deal fields in the formula:

-   #Deal Value
-   #Deal Probability
-   #Deal Score
-   #Deal Total activities
-   #Deal Done activities
-   #Deal Activities to do
-   #Deal Email messages count
-   Any of your custom numerical and monetary deal fields

**Note:** All formulas must contain a **“#”** followed by an input field (e.g., #Deal Value). Otherwise, the formula will be invalid.

Use the following symbols to define your mathematical operations:

| **Symbol** | **Usage** | **Example** |
| --- | --- | --- |
| **#** | Defines the field used as a variable in the formula | To calculate 10% commission, use **_#_**_Deal value \\* 0.1_ |
| **+** , **\\-** | Adds or subtracts values | To calculate the profit from the deal while having a custom field named “Costs”, use _#Deal value **\\-** #Deal Costs_ |
| **\\*** , **/** | Multiplies or divides values | To calculate lifetime value (LTV) in a scenario where you sell annual subscriptions and have found that the average customer lifespan is 3.4 years, use _#Deal Value **\\*** 3.40_ |
| **( )** | Used to group values and operators | To calculate the completion rate of activities, use _**(** #Deal Done activities / #Deal total activities **)** \\* 100_ |
| **%** | Calculates a percentage of a selected field | To calculate a 10% discount, use _#Deal value - 10**%**_ (subtracts 10% of the deal value) |

### Applying the formula to deals

After you write the formula, choose whether it’s applied to **new deals** or **only new and open deals**.

![](https://kb-cms.pipedriveassets.com/ff3_2025-10-10-081037_ayup.png)

If you select “**Apply formula to only new and open deals”**, you’ll need to confirm the calculation before it applies.

![](https://kb-cms.pipedriveassets.com/fieldcalcmessage.png)

Once you’re ready, click **“Save”** as the final step.

* * *

## Formula fields in action

**Note:** Formulas won’t run unless **all input fields** in the formula have values. If a field is empty, the formula will return a null value with the message **not calculated**.

When a deal includes all the required input fields, the formula is calculated automatically.

In the example below, the formula field called “Commission fee” uses only the deal value of $500 as an input, which is then multiplied by 5%.

![](https://kb-cms.pipedriveassets.com/ff4.png)

As a result, the “Commission fee” returns $25.

### Recalculating formula fields

Formula calculation results update automatically in the following cases:

-   Formulas are created or edited
-   Deals are created
-   Deal fields included in the formula are edited

You can also recalculate a formula manually in these areas:

#### Deal detail view

Hover over the formula field under the details section and click the **refresh button**.

![](https://kb-cms.pipedriveassets.com/ff5.png)

#### Deal list view

Find and add the formula field from the **gear icon** to the list view.

![](https://kb-cms.pipedriveassets.com/ff7.png)

Then hover over the formula field and click the **refresh button**.

![](https://kb-cms.pipedriveassets.com/ff6.png)

To recalculate multiple deals simultaneously, use the **[bulk edit](https://support.pipedrive.com/article/bulk-editing-and-filtering)** tool. Select the deals, find the formula field on the right, then choose:

-   **“Recalculate if input is changed”** to apply only where field values have been updated
-   **“Force recalculate”** to reapply the formula to all selected items

![](https://kb-cms.pipedriveassets.com/Screenshot%202023-02-07%20at%209.35.51%20AM.png)

Finally, click **“Edit deals”** and confirm changes.
