---
schema_version: "1"
id: 65f1c133072e9f654590fc47ab46fcac8b2712bf3c296cb77102f5ecdd5f6134
title: Calculate Field Values with Formulas
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/customize_formuladef.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.customize_formuladef.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 8eca6ee8c452b8d2537f8b3bb4b2944d089170311348c9e32967fdc612b284c4
description: A formula is an algorithm that derives its value from other fields, expressions, or values. Formulas can help you automatically calculate the value of a field based on other fields.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Calculate Field Values with Formulas

A formula is an algorithm that derives its value from other fields, expressions, or values. Formulas can help you automatically calculate the value of a field based on other fields.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
      <colgroup>
        <col>
      </colgroup>
      <tbody>
        <tr class="">
          <td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic and
            Lightning Experience</td>

        </tr>
        <tr class="">
          <td class="slds-cell-wrap" style="vertical-align:top;">
            <p>Available in: <strong>All</strong> Editions</p>
            <p style="margin-bottom:0;">Reports and Approvals aren’t available in
              <strong>Database.com</strong>
            </p>
          </td>

        </tr>
      </tbody>
    </table>

![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_tip.png)

Tip Setup with Agentforce can help you work with formulas more efficiently. For more information, see [Setup with Agentforce](https://help.salesforce.com/s/articleView?id=xcloud.setup_agentforce_overview.htm&language=en_US) and [Formulas in Setup with Agentforce](https://help.salesforce.com/s/articleView?id=xcloud.setup_agentforce_formula.htm&language=en_US).

Watch a Demo: [![Watch Video Demo](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/extend_click/images/play_btn.png) Getting Started With Formulas (Salesforce Classic)](https://salesforce.vidyard.com/watch/EC0MrR6ZMU4CiHyFaakGhg)

This video gives a brief introduction to Salesforce formulas, accessing the formulas editor in the app, and how to use the editor tools to create formulas.

- **[Where are Formulas Used in Salesforce?](https://help.salesforce.com/s/articleView?id=platform.customize_formula_where.htm&release=264.0.0&type=5)**  
    Many areas in Salesforce use formulas. Before you begin using formulas, review the differences in their uses.
- **[Formula Data Types](https://help.salesforce.com/s/articleView?id=platform.choosing_a_formula_data_type.htm&release=264.0.0&type=5)**  
    The data type of a formula determines the type of data you expect returned from your formula.
- **[Elements of a Formula](https://help.salesforce.com/s/articleView?id=platform.elements_of_a_formula.htm&release=264.0.0&type=5)**  
    Learn the elements you can combine to build a formula: literal values, field references, functions, operators, and comments. Understand what each element does and see an example of how to enter it.
- **[Formula Operators and Functions by Context](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5)**  
    Use these operators and functions when building formulas. All functions are available everywhere that you can include a formula, such as formula fields, validation rules, approval processes, and workflow rules, unless otherwise specified.
- **[Using Date, Date/Time, and Time Values in Formulas](https://help.salesforce.com/s/articleView?id=platform.formula_using_date_datetime.htm&release=264.0.0&type=5)**  
    Use Date, Date/Time, and Time values in formulas to manage payment deadlines, calculate contract ages, and support other time-dependent business needs. Learn how to create and compare these values, convert between data types and text, and account for time zones.
- **[Build a Formula Field](https://help.salesforce.com/s/articleView?id=platform.customize_formulas.htm&release=264.0.0&type=5)**  
    Your custom formula fields require special attributes.
- **[Formula Field Limits and Restrictions](https://help.salesforce.com/s/articleView?id=platform.formula_field_limits.htm&release=264.0.0&type=5)**  
    Before you create formula fields, be aware of their limits and limitations.
- **[Formula Best Practices](https://help.salesforce.com/s/articleView?id=platform.customize_formula_best_practices.htm&release=264.0.0&type=5)**  
    You can use the Formula Editor in Salesforce to construct a simple formula with a few clicks. But what if you want to build something more complex? Use these tips to help you map out formula logic and make it easier to troubleshoot errors.
- **[Find Examples of Advanced Formulas](https://help.salesforce.com/s/articleView?id=platform.useful_advanced_formulas.htm&release=264.0.0&type=5)**  
    Review sample formulas for sales, service, financial, employee-services, and integration scenarios. Examples cover commissions and discounts, cross-object references, date and time calculations, image links, data completeness, and more. Adapt the formulas to your fields and business requirements.
- **[Formulas: How Do I ... ?](https://help.salesforce.com/s/articleView?id=platform.how_do_i.htm&release=264.0.0&type=5)**  
    A collection of topics around formulas, including common math calculation, text functions, and more.
- **[Common Formula Errors](https://help.salesforce.com/s/articleView?id=platform.fixing_formula_errors.htm&release=264.0.0&type=5)**  
    Review common errors that can occur with formulas and how to fix them.
- **[Get an Explanation for a Formula and Fix Errors with Einstein for Formulas](https://help.salesforce.com/s/articleView?id=platform.formulas_einstein_fix_formula.htm&release=264.0.0&type=5)**  
    Use Einstein for Formulas to get an explanation for a formula and fix syntax errors in a formula used in Formula fields, default field values, and record validation rules. As an admin, you can use Einstein’s assistance for existing formulas or for the new ones that you create.