---
schema_version: "1"
id: 0091f3ca9d0280151f31010920a13909ae533a8c3d20a6bf4a1f241f0c75a868
title: Formula Operators and Functions by Context
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/customize_functions.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 40d5f2a1715edca25abd77bcf3cbb58d4abbcd2bf814d44b6974d230711e7b29
description: 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.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Formula Operators and Functions by Context

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.

Within an email template, merge fields can only be used in formula functions and operations when the merge field belongs to the record that the email is related to. Otherwise, these fields don’t resolve.

Extraneous spaces in these samples are ignored.

- [Math Operators](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5)
- [Logical Operators](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5)
- [Text Operators](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5)
- [Date and Time Functions](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5)
- [Logical Functions](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5)
- [Math Functions](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5)
- [Text Functions](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5)
- [Summary Functions](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5)
- [Advanced Functions](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5)

## Math Operators

 
| Operator | Description |
| --- | --- |
| [\+ (Add)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_add.htm&release=264.0.0&type=5 "Calculates the sum of two values.") | Calculates the sum of two values. |
| [\- (Subtract)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_subtract.htm&release=264.0.0&type=5 "Calculates the difference of two values.") | Calculates the difference of two values. |
| [\* (Multiply)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_multiply.htm&release=264.0.0&type=5 "Multiplies its values.") | Multiplies its values. |
| [/ (Divide)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_divide.htm&release=264.0.0&type=5 "Divides its values.") | Divides its values. |
| [^ (Exponentiation)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_exponentiation.htm&release=264.0.0&type=5 "Raises a number to a power of a specified number.") | Raises a number to the power of a specified number. |
| [() (Open Parenthesis and Closed Parenthesis)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_open_parenthesis_and_close_parenthesis.htm&release=264.0.0&type=5 "Specifies that the expressions within the open parenthesis and close parenthesis are evaluated first. All other expressions are evaluated using standard operator precedence.") | Specifies that the expressions within the open parenthesis and close parenthesis are evaluated first. All other expressions are evaluated using standard operator precedence. |

## Logical Operators

 
| Operator | Description |
| --- | --- |
| [\= and == (Equal)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_and_equal.htm&release=264.0.0&type=5 "Evaluates if two values are equivalent. The = and == operators are interchangeable.") | Evaluates if two values are equivalent. The = and == operators are interchangeable. |
| [<> and != (Not Equal)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_not_equal.htm&release=264.0.0&type=5 "Evaluates if two values aren’t equivalent.") | Evaluates if two values aren’t equivalent. |
| [< (Less Than)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_less_than.htm&release=264.0.0&type=5 "Evaluates if a value is less than the value that follows this symbol.") | Evaluates if a value is less than the value that follows this symbol. |
| [\> (Greater Than)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_greater_than.htm&release=264.0.0&type=5 "Evaluates if a value is greater than the value that follows this symbol.") | Evaluates if a value is greater than the value that follows this symbol. |
| [<= (Less Than or Equal)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_less_than_or_equal.htm&release=264.0.0&type=5 "Evaluates if a value is less than or equal to the value that follows this symbol.") | Evaluates if a value is less than or equal to the value that follows this symbol. |
| [\>= (Greater Than or Equal)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_greater_than_or_equal.htm&release=264.0.0&type=5 "Evaluates if a value is greater than or equal to the value that follows this symbol.") | Evaluates if a value is greater than or equal to the value that follows this symbol. |
| [&& (And)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_and.htm&release=264.0.0&type=5 "Evaluates if two values or expressions are both true. Use this operator as an alternative to the logical function AND.") | Evaluates if two values or expressions are both true. Use this operator as an alternative to the logical function AND. |
| [|| (Or)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_or.htm&release=264.0.0&type=5 "Evaluates if at least one of multiple values or expressions is true. Use this operator as an alternative to the logical function OR.") | Evaluates if at least one of multiple values or expressions is true. Use this operator as an alternative to the logical function OR. |

## Text Operators

 
| Operator | Description |
| --- | --- |
| [& and + (Concatenate)](https://help.salesforce.com/s/articleView?id=platform.customize_functions_and_concatenate.htm&release=264.0.0&type=5 "Connects two or more strings.") | Connects two or more strings. |

## Date and Time Functions

 
| Function | Description |
| --- | --- |
| [ADDMONTHS](https://help.salesforce.com/s/articleView?id=platform.customize_functions_addmonths.htm&release=264.0.0&type=5 "Returns the date that is the indicated number of months before or after a specified date. If the specified date is the last day of the month, the resulting date is the last day of the resulting month. Otherwise, the result has the same date component as the specified date.") | Returns the date that is the indicated number of months before or after a specified date. If the specified date is the last day of the month, the resulting date is the last day of the resulting month. Otherwise, the result has the same date component as the specified date. |
| [DATE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_date.htm&release=264.0.0&type=5 "Returns a date value from the year, month, and day values you enter. Salesforce displays an error on the detail page if the value of the DATE function in a formula field is an invalid date, such as February 29 in a non-leap year.") | Returns a date value from the year, month, and day values that you enter. Salesforce displays an error on the detail page if the value of the DATE function in a formula field is an invalid date, such as February 29 in a non-leap year. |
| [DATEVALUE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_datevalue.htm&release=264.0.0&type=5 "Returns a date value for a date/time or text expression.") | Returns a date value for a date/time or text expression. |
| [DATETIMEVALUE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_datetimevalue.htm&release=264.0.0&type=5 "Returns a year, month, day, and GMT time value.") | Returns a year, month, day, and GMT time value. |
| [DAY](https://help.salesforce.com/s/articleView?id=platform.customize_functions_day.htm&release=264.0.0&type=5 "Returns a day of the month in the form of a number from 1 through 31.") | Returns a day of the month in the form of a number from 1 through 31. |
| DAYOFYEAR | Returns the day of the calendar year in the form of a number from 1 through 366. |
| FORMATDURATION | Formats the number of seconds with optional days, or the difference between times or dateTimes as HH:MI:SS. |
| [HOUR](https://help.salesforce.com/s/articleView?id=platform.customize_functions_hour.htm&release=264.0.0&type=5 "Returns the local time hour value without the date in the form of a number from 1 through 24.") | Returns the local time hour value without the date in the form of a number from 1 through 24. |
| ISOWEEK | Returns the ISO 8601-week number, from 1 through 53, for the given date, ensuring that the first week starts on a Monday. |
| ISOYEAR | Returns the ISO 8601 week-numbering year in 4 digits for the given date, ensuring that the first day is a Monday. |
| [MILLISECOND](https://help.salesforce.com/s/articleView?id=platform.customize_functions_millisecond.htm&release=264.0.0&type=5 "Returns a milliseconds value in the form of a number from 0 through 999.") | Returns a milliseconds value in the form of a number from 0 through 999. |
| [MINUTE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_minute.htm&release=264.0.0&type=5 "Returns a minute value in the form of a number from 0 through 60.") | Returns a minute value in the form of a number from 0 through 60. |
| [MONTH](https://help.salesforce.com/s/articleView?id=platform.customize_functions_month.htm&release=264.0.0&type=5 "Returns the month, a number from 1 (January) through 12 (December) in number format of a given date.") | Returns the month, a number from 1 (January) through 12 (December) in number format of a given date. |
| [NOW](https://help.salesforce.com/s/articleView?id=platform.customize_functions_now.htm&release=264.0.0&type=5 "Returns a date/time representing the current moment.") | Returns a date/time representing the current moment. |
| [SECOND](https://help.salesforce.com/s/articleView?id=platform.customize_functions_second.htm&release=264.0.0&type=5 "Returns a seconds value in the form of a number from 0 through 60.") | Returns a seconds value in the form of a number from 0 through 60. |
| [TIMENOW](https://help.salesforce.com/s/articleView?id=platform.customize_functions_timenow.htm&release=264.0.0&type=5 "Returns a time value in GMT representing the current moment. Use this function instead of the NOW function if you only want to track time, without a date.") | Returns a time value in GMT representing the current moment. Use this function instead of the NOW function if you only want to track time, without a date. |
| [TIMEVALUE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_timevalue.htm&release=264.0.0&type=5 "Returns the time value without the date, such as business hours.") | Returns the time value without the date, such as business hours. |
| [TODAY](https://help.salesforce.com/s/articleView?id=platform.customize_functions_today.htm&release=264.0.0&type=5 "Returns the current date as a date data type.") | Returns the current date as a date data type. |
| UNIXTIMESTAMP | Returns the number of seconds since 1 Jan 1970 for the given date, or number of seconds in the day for a time. |
| [WEEKDAY](https://help.salesforce.com/s/articleView?id=platform.customize_functions_weekday.htm&release=264.0.0&type=5 "Returns the day of the week for the given date, using 1 for Sunday, 2 for Monday, through 7 for Saturday.") | Returns the day of the week for the given date, using 1 for Sunday, 2 for Monday, through 7 for Saturday. |
| [YEAR](https://help.salesforce.com/s/articleView?id=platform.customize_functions_year.htm&release=264.0.0&type=5 "Returns the four-digit year in number format of a given date.") | Returns the four-digit year in number format of a given date. |

## Logical Functions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:22.5%">
          <col style="width:77.5%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d150020e794">Function</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d150020e797">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_and1.htm&amp;release=264.0.0&amp;type=5" title="Returns a TRUE response if all values are true; returns a FALSE response if one or more values are false.">AND</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Returns a TRUE response if all values are true, and returns a FALSE
              response if one or more values are false.</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_blankvalue.htm&amp;release=264.0.0&amp;type=5" title="Determines if an expression has a value and returns a substitute expression if it doesn’t. If the expression has a value, returns the value of the expression.">BLANKVALUE</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Determines if an expression has a value, and returns a substitute
              expression if it doesn’t. If the expression has a value, returns the value
              of the expression.</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_case.htm&amp;release=264.0.0&amp;type=5" title="Checks a given expression against a series of values. If the expression is equal to a value, returns the corresponding result. If it isn't equal to any of the values, returns the else_result.">CASE</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Checks a given expression against a series of values. If the expression
              is equal to a value in the series, returns the corresponding result. If it
              isn’t equal to a value in the series, returns the <code>else_result</code>.</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_if.htm&amp;release=264.0.0&amp;type=5" title="Determines if expressions are true or false. Returns a given value if true and another value if false.">IF</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Determines if expressions are true or false. Returns a given value if
              true and another value if false.</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_isblank.htm&amp;release=264.0.0&amp;type=5" title="Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE.">ISBLANK</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Determines if an expression has a value, and returns TRUE if it doesn’t.
              If it contains a value, returns FALSE.</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_isclone.htm&amp;release=264.0.0&amp;type=5" title="Checks if the record is a clone of another record and returns TRUE if one item is a clone. Otherwise, returns FALSE.">ISCLONE</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Checks if the record is a clone of another record, and returns TRUE if
              one item is a clone. Otherwise, returns FALSE.</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_isnew.htm&amp;release=264.0.0&amp;type=5" title="Checks if the formula is running during the creation of a new record and returns TRUE if it is. If an existing record is being updated, this function returns FALSE.">ISNEW</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Checks if the formula is running during the creation of a new record,
              and returns TRUE if it is. If an existing record is being updated, returns
              FALSE.</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_isnull.htm&amp;release=264.0.0&amp;type=5" title="Determines if an expression is null (blank) and returns TRUE if it is. If it contains a value, this function returns FALSE.">ISNULL</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">
              <p>Determines if an expression is null (blank), and returns TRUE if it is.
                If it contains a value, returns FALSE.</p>
              <p style="margin-bottom:0;">You must use ISBLANK instead of
                ISNULL in new formulas. ISBLANK has the same functionality as ISNULL, but
                also supports text fields. Salesforce continues to support ISNULL, so you
                don’t change any existing formulas.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_isnumber.htm&amp;release=264.0.0&amp;type=5" title="Determines if a text value is a number and returns TRUE if it is. Otherwise, returns FALSE.">ISNUMBER</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Determines if a text value is a number, and returns TRUE if it is.
              Otherwise, returns FALSE.</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_not.htm&amp;release=264.0.0&amp;type=5" title="Returns FALSE for TRUE and TRUE for FALSE.">NOT</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Returns FALSE for TRUE and TRUE for FALSE.</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_nullvalue.htm&amp;release=264.0.0&amp;type=5" title="Determines if an expression is null (blank) and returns a substitute expression if it is. If the expression is not blank, returns value of the expression.">NULLVALUE</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">
              <p>Determines if an expression is null (blank) and returns a substitute
                expression if it is. If the expression isn’t blank, returns the value of the
                expression.
              </p>
              <p style="margin-bottom:0;">You must use BLANKVALUE instead of NULLVALUE in new formulas.
                BLANKVALUE has the same functionality as NULLVALUE, but it also supports
                text fields. Salesforce continues to support NULLVALUE, so changing the
                existing formulas isn’t necessary.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_or_0.htm&amp;release=264.0.0&amp;type=5" title="Determines if expressions are true or false. Returns TRUE if any expression is true. Returns FALSE if all expressions are false.">OR</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Determines if expressions are true or false. Returns TRUE if any
              expression is true, and returns FALSE if all expressions are false.</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e794 ">
              <a href="https://help.salesforce.com/s/articleView?id=platform.customize_functions_priorvalue.htm&amp;release=264.0.0&amp;type=5" title="Returns the previous value of a field.">PRIORVALUE</a>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d150020e797 ">Returns the previous value of a field.</td>

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

## Math Functions

 
| Function | Description |
| --- | --- |
| [ABS](https://help.salesforce.com/s/articleView?id=platform.customize_functions_abs.htm&release=264.0.0&type=5 "Calculates the absolute value of a number. The absolute value of a number is the number without its positive or negative sign.") | Calculates the absolute value of a number. The absolute value of a number is the number without its positive or negative sign. |
| ACOS | Returns the arc cosign of the number in radians, if the given number is from -1 through 1. Otherwise, returns NULL. |
| ASIN | Returns the arc sine of the number in radians, if the given number is from -1 through 1. Otherwise, returns NULL. |
| ATAN | Returns the arc tangent of the number in radians. |
| ATAN2 | Returns the arc tangent of the quotient of y and x in radians. |
| [CEILING](https://help.salesforce.com/s/articleView?id=platform.customize_functions_ceiling.htm&release=264.0.0&type=5 "Rounds a number up to the nearest integer, away from zero if negative.") | Rounds a number up to the nearest integer, away from zero if negative. |
| CHR | Returns a string with the first character’s code point as the given number. |
| COS | Returns the cosine of the number in radians, if the given number is from -1 through 1. Otherwise, returns NULL. |
| [DISTANCE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_distance.htm&release=264.0.0&type=5 "Calculates the distance between two locations in miles or kilometers.") | Calculates the distance between two locations in miles or kilometers. |
| [EXP](https://help.salesforce.com/s/articleView?id=platform.customize_functions_exp.htm&release=264.0.0&type=5 "Returns a value for e raised to the power of a number you specify.") | Returns a value for e raised to the power of a number that you specify. |
| [FLOOR](https://help.salesforce.com/s/articleView?id=platform.customize_functions_floor.htm&release=264.0.0&type=5 "Returns a number rounded down to the nearest integer, towards zero if negative.") | Returns a number rounded down to the nearest integer, towards zero if negative. |
| FROMUNIXTIME | Returns the datetime that represents the given number as the seconds elapsed since 1 Jan 1970. |
| [GEOLOCATION](https://help.salesforce.com/s/articleView?id=platform.customize_functions_geolocation.htm&release=264.0.0&type=5 "Returns a geolocation based on the provided latitude and longitude. Must be used with the DISTANCE function.") | Returns a geolocation based on the provided latitude and longitude. Must be used with the DISTANCE function. |
| [LN](https://help.salesforce.com/s/articleView?id=platform.customize_functions_ln.htm&release=264.0.0&type=5 "Returns the natural logarithm of a specified number. Natural logarithms are based on the constant e value of 2.71828182845904.") | Returns the natural logarithm of a specified number. Natural logarithms are based on the constant e value of 2.71828182845904. |
| [LOG](https://help.salesforce.com/s/articleView?id=platform.customize_functions_log.htm&release=264.0.0&type=5 "Returns the base 10 logarithm of a number.") | Returns the base 10 logarithm of a number. |
| [MAX](https://help.salesforce.com/s/articleView?id=platform.customize_functions_max.htm&release=264.0.0&type=5 "Returns the highest number from a list of numbers.") | Returns the highest number from a list of numbers. |
| [MCEILING](https://help.salesforce.com/s/articleView?id=platform.customize_functions_mceiling.htm&release=264.0.0&type=5 "Rounds a number up to the nearest integer, towards zero if negative.") | Rounds a number up to the nearest integer, towards zero if negative. |
| [MFLOOR](https://help.salesforce.com/s/articleView?id=platform.customize_functions_mfloor.htm&release=264.0.0&type=5 "Rounds a number down to the nearest integer, away from zero if negative.") | Rounds a number down to the nearest integer, away from zero if negative. |
| [MIN](https://help.salesforce.com/s/articleView?id=platform.customize_functions_min.htm&release=264.0.0&type=5 "Returns the lowest number from a list of numbers.") | Returns the lowest number from a list of numbers. |
| [MOD](https://help.salesforce.com/s/articleView?id=platform.customize_functions_mod.htm&release=264.0.0&type=5 "Returns a remainder after a number is divided by a specified divisor.") | Returns a remainder after a number is divided by a specified divisor. |
| PI | Returns pi. |
| PICKLISTCOUNT | Returns the number of selected values in a multi-select picklist. |
| [ROUND](https://help.salesforce.com/s/articleView?id=platform.customize_functions_round.htm&release=264.0.0&type=5 "Returns the nearest number to a number you specify, constraining the new number by a specified number of digits.") | Returns the nearest number to a number that you specify, constraining the new number by a specified number of digits. |
| SIN | Returns the sine of the number, where the number is given in radians. |
| [SQRT](https://help.salesforce.com/s/articleView?id=platform.customize_functions_sqrt.htm&release=264.0.0&type=5 "Returns the positive square root of a given number.") | Returns the positive square root of a given number. |
| TAN | Returns the tangent of the number, where the number is given in radians. |
| TRUNC | Truncates a number to a specified number of digits. |

## Text Functions

 
| Function | Description |
| --- | --- |
| ASCII | Returns the first character’s code point from the given string as a number. |
| [BEGINS](https://help.salesforce.com/s/articleView?id=platform.customize_functions_begins.htm&release=264.0.0&type=5 "Determines if text begins with specific characters and returns TRUE if it does. Returns FALSE if it doesn't.") | Determines if text begins with specific characters. Returns TRUE if it does, and returns FALSE if it doesn't. |
| [BR](https://help.salesforce.com/s/articleView?id=platform.customize_functions_br.htm&release=264.0.0&type=5 "Inserts a line break in a string of text.") | Inserts a line break in a string of text. |
| [CASESAFEID](https://help.salesforce.com/s/articleView?id=platform.customize_functions_casesafeid.htm&release=264.0.0&type=5 "Converts a 15-character ID to a case-insensitive 18-character ID. In Salesforce Classic, the function converts only valid Salesforce 15-character IDs. If you pass in an invalid ID, the function returns the ID passed in. In Lightning Experience, the function converts any 15-character ID.") | Converts a 15-character ID to a case-insensitive 18-character ID. |
| [CONTAINS](https://help.salesforce.com/s/articleView?id=platform.customize_functions_contains.htm&release=264.0.0&type=5 "Compares two arguments of text and returns TRUE if the first argument contains the second argument. If not, returns FALSE.") | Compares two arguments of text, and returns TRUE if the first argument contains the second argument. If not, returns FALSE. |
| [FIND](https://help.salesforce.com/s/articleView?id=platform.customize_functions_find.htm&release=264.0.0&type=5 "Returns the position of a string within a string of text represented as a number.") | Returns the position of a string within a string of text represented as a number. |
| [GETSESSIONID](https://help.salesforce.com/s/articleView?id=platform.customize_functions_getsessionid.htm&release=264.0.0&type=5 "Returns the user’s session ID.") | Returns the user’s session ID. |
| [HTMLENCODE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_htmlencode.htm&release=264.0.0&type=5 "Encodes text and merge field values for use in HTML by replacing characters that are reserved in HTML, such as the greater-than sign (>), with HTML entity equivalents, such as &gt;.") | Encodes text and merge field values for use in HTML by replacing characters that are reserved in HTML, such as the greater-than sign (>), with HTML entity equivalents, such as `&gt;`. |
| [HYPERLINK](https://help.salesforce.com/s/articleView?id=platform.customize_functions_hyperlink.htm&release=264.0.0&type=5 "Creates a link to a URL specified that is linkable from the text specified.") | Creates a link to a URL specified that is linkable from the text specified. |
| [IMAGE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_image.htm&release=264.0.0&type=5 "Inserts an image with alternate text and height and width specifications.") | Inserts an image with alternate text and height and width specifications. |
| [INCLUDES](https://help.salesforce.com/s/articleView?id=platform.customize_functions_includes.htm&release=264.0.0&type=5 "Determines if any value selected in a multi-select picklist field equals a text literal you specify.") | Determines if any value selected in a multi-select picklist field equals a text literal that you specify. |
| INITCAP | Returns the text as lowercase with the first character of each word in uppercase. |
| [ISPICKVAL](https://help.salesforce.com/s/articleView?id=platform.customize_functions_ispickval.htm&release=264.0.0&type=5 "Determines if the value of a picklist field is equal to a text literal you specify.") | Determines if the value of a picklist field is equal to a text literal that you specify. |
| [JSENCODE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_jsencode.htm&release=264.0.0&type=5 "Encodes text and merge field values for use in JavaScript by inserting escape characters, such as a backslash (\), before unsafe JavaScript characters, such as the apostrophe (').") | Encodes text and merge field values for use in JavaScript by inserting escape characters, such as a backslash (\\), before unsafe JavaScript characters, such as the apostrophe ('). |
| [JSINHTMLENCOD](https://help.salesforce.com/s/articleView?id=platform.customize_functions_jsinhtmlencode.htm&release=264.0.0&type=5 "Encodes text and merge field values for use in JavaScript inside HTML tags by replacing characters that are reserved in HTML with HTML entity equivalents and inserting escape characters before unsafe JavaScript characters.") | Encodes text and merge field values for use in JavaScript inside HTML tags by replacing characters that are reserved in HTML with HTML entity equivalents and inserting escape characters before unsafe JavaScript characters. `JSINHTMLENCODE(someValue)` is a convenience function that is equivalent to `JSENCODE(HTMLENCODE((someValue))`. That is, `JSINHTMLENCODE` first encodes someValue with `HTMLENCODE`, and then encodes the result with `JSENCODE`. |
| [LEFT](https://help.salesforce.com/s/articleView?id=platform.customize_functions_left.htm&release=264.0.0&type=5 "Returns the specified number of characters from the beginning of a text string.") | Returns the specified number of characters from the beginning of a text string. |
| [LEN](https://help.salesforce.com/s/articleView?id=platform.customize_functions_len.htm&release=264.0.0&type=5 "Returns the number of characters in a specified text string.") | Returns the number of characters in a specified text string. |
| [LOWER](https://help.salesforce.com/s/articleView?id=platform.customize_functions_lower.htm&release=264.0.0&type=5 "Converts all letters in the specified text string to lowercase. Any characters that are not letters are unaffected by this function. Locale rules are applied if a locale is provided.") | Converts all letters in the specified text string to lowercase. Any characters that aren’t letters are unaffected by this function. Locale rules are applied if a locale is provided. |
| [LPAD](https://help.salesforce.com/s/articleView?id=platform.customize_functions_lpad.htm&release=264.0.0&type=5 "Inserts characters you specify to the left-side of a text string.") | Inserts characters that you specify to the left-side of a text string. |
| [MID](https://help.salesforce.com/s/articleView?id=platform.customize_functions_mid.htm&release=264.0.0&type=5 "Returns the specified number of characters from the middle of a text string given the starting position.") | Returns the specified number of characters from the middle of a text string given the starting position. |
| [REVERSE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_reverse.htm&release=264.0.0&type=5 "Returns the characters of a source text string in reverse order.") | Returns the characters of a source text string in reverse order. |
| [RIGHT](https://help.salesforce.com/s/articleView?id=platform.customize_functions_right.htm&release=264.0.0&type=5 "Returns the specified number of characters from the end of a text string.") | Returns the specified number of characters from the end of a text string. |
| [RPAD](https://help.salesforce.com/s/articleView?id=platform.customize_functions_rpad.htm&release=264.0.0&type=5 "Inserts characters that you specify to the right-side of a text string.") | Inserts characters that you specify to the right-side of a text string. |
| [SUBSTITUTE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_substitute.htm&release=264.0.0&type=5 "Substitutes new text for old text in a text string.") | Substitutes new text for old text in a text string. |
| [TEXT](https://help.salesforce.com/s/articleView?id=platform.customize_functions_text.htm&release=264.0.0&type=5 "Converts a percent, number, date, date/time, or currency type field into text anywhere formulas are used. Also, converts picklist values to text in approval rules, approval step rules, workflow rules, escalation rules, assignment rules, auto-response rules, validation rules, formula fields, field updates, and custom buttons and links.") | Converts a percent, number, date, date/time, or currency type field into text anywhere formulas are used. Also, converts picklist values to text in approval rules, approval step rules, workflow rules, escalation rules, assignment rules, auto-response rules, validation rules, formula fields, field updates, and custom buttons and links. |
| [TRIM](https://help.salesforce.com/s/articleView?id=platform.customize_functions_trim.htm&release=264.0.0&type=5 "Removes the spaces and tabs from the beginning and end of a text string.") | Removes the spaces and tabs from the beginning and end of a text string. |
| [UPPER](https://help.salesforce.com/s/articleView?id=platform.customize_functions_upper.htm&release=264.0.0&type=5 "Converts all letters in the specified text string to uppercase.") | Converts all letters in the specified text string to uppercase. Any characters that aren’t letters are unaffected by this function. Locale rules are applied if a locale is provided. |
| [URLENCODE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_urlencode.htm&release=264.0.0&type=5 "Encodes text and merge field values for use in URLs by replacing characters that are illegal in URLs, such as blank spaces, with the code that represent those characters as defined in RFC 3986, Uniform Resource Identifier (URI): Generic Syntax.") | Encodes text and merge field values for use in URLs by replacing characters that are illegal in URLs, such as blank spaces, with the code that represent those characters as defined in RFC 3986, Uniform Resource Identifier (URI): Generic Syntax. For example, blank spaces are replaced with `%20`, and exclamation points are replaced with `%21`. |
| [VALUE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_value.htm&release=264.0.0&type=5 "Converts a text string to a number.") | Converts a text string to a number. |

## Summary Functions

These functions are available with summary, matrix, and joined reports.

 
| Function | Description |
| --- | --- |
| [PARENTGROUPVAL](https://help.salesforce.com/s/articleView?id=platform.customize_functions_parentgroupval.htm&release=264.0.0&type=5 "This function returns the value of a specified parent grouping. A “parent” grouping is any level above the one containing the formula.") | Returns the value of a specified parent grouping. A “parent” grouping is any level above the one containing the formula. You can use this function only in custom summary formulas and at grouping levels for reports, but not at summary levels. |
| [PREVGROUPVAL](https://help.salesforce.com/s/articleView?id=platform.customize_functions_prevgroupval.htm&release=264.0.0&type=5 "This function returns the value of a specified previous grouping. A “previous” grouping is one that comes before the current grouping in the report.") | Returns the value of a specified previous grouping. A “previous” grouping is one that comes before the current grouping in the report. Choose the grouping level and increment. The increment is the number of columns or rows before the current summary. The default is 1, the maximum is 12. You can use this function only in custom summary formulas and at grouping levels for reports, but not at summary levels. |

## Advanced Functions

 
| Function | Description |
| --- | --- |
| [CURRENCYRATE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_currencyrate.htm&release=264.0.0&type=5 "Returns the conversion rate to the corporate currency for the given currency ISO code. If the currency is invalid, returns 1.0.") | Returns the conversion rate to the corporate currency for the given currency ISO code. If the currency is invalid, returns 1.0. |
| [GETRECORDIDS](https://help.salesforce.com/s/articleView?id=platform.customize_functions_getrecordsids.htm&release=264.0.0&type=5 "Returns an array of strings in the form of record IDs for the selected records in a list, such as a list view or related list.") | Returns an array of strings in the form of record IDs for the selected records in a list, such as a list view or related list. |
| [IMAGEPROXYURL](https://help.salesforce.com/s/articleView?id=platform.customize_functions_imageproxyurl.htm&release=264.0.0&type=5 "Securely retrieves external images and prevents unauthorized requests for user credentials.") | Securely retrieves external images, and prevents unauthorized requests for user credentials. |
| [INCLUDE](https://help.salesforce.com/s/articleView?id=platform.customize_functions_include.htm&release=264.0.0&type=5 "Returns content from an s-control snippet. Use this function to reuse common code in many s-controls.") | Returns content from an s-control snippet. Use this function to reuse common code in many s-controls. |
| [ISCHANGED](https://help.salesforce.com/s/articleView?id=platform.customize_functions_ischanged.htm&release=264.0.0&type=5 "Compares the value of a field to the previous value and returns TRUE if the values are different. If the values are the same, this function returns FALSE.") | Compares the value of a field to the previous value, and returns TRUE if the values are different. If the values are the same, returns FALSE. |
| [JUNCTIONIDLIST](https://help.salesforce.com/s/articleView?id=platform.customize_functions_junctionidlist.htm&release=264.0.0&type=5 "Returns a JunctionIDList based on the provided IDs.") | Returns a JunctionIDList based on the provided IDs. |
| [LINKTO](https://help.salesforce.com/s/articleView?id=platform.customize_functions_linkto.htm&release=264.0.0&type=5 "Returns a relative URL in the form of a link (href and anchor tags) for a custom s-control or Salesforce page.") | Returns a relative URL in the form of a link (href and anchor tags) for a custom s-control or Salesforce page. |
| [PREDICT](https://help.salesforce.com/s/articleView?id=platform.customize_functions_predict.htm&release=264.0.0&type=5 "Returns an Einstein Discovery prediction for a record based on the specified record ID or for a list of fields and their values.") | Returns an Einstein Discovery prediction for a record based on the specified record ID or for a list of fields and their values. |
| [REGEX](https://help.salesforce.com/s/articleView?id=platform.customize_functions_regex.htm&release=264.0.0&type=5 "Compares a text field to a regular expression and returns TRUE if there is a match. Otherwise, returns FALSE.") | Compares a text field to a regular expression, and returns TRUE if there’s a match. Otherwise, returns FALSE. A regular expression is a string used to describe a format of a string according to certain syntax rules. |
| [REQUIRESCRIPT](https://help.salesforce.com/s/articleView?id=platform.customize_functions_requirescript.htm&release=264.0.0&type=5 "Returns a script tag with URL source that you specify. Use this function when referencing the Lightning Platform AJAX Toolkit or other JavaScript toolkits.") | Returns a script tag with source for a URL that you specify. Use this function when referencing the Lightning Platform AJAX Toolkit or other JavaScript toolkits. |
| [URLFOR](https://help.salesforce.com/s/articleView?id=platform.customize_functions_urlfor.htm&release=264.0.0&type=5 "Returns a URL for an action, an s-control, a Visualforce page, or a file in a static resource archive. URLFOR is available for use in custom buttons and links, s-controls, and Visualforce pages.") | Returns a relative URL for an action, s-control, Visualforce page, or a file in a static resource archive in a Visualforce page. |
| [VLOOKUP](https://help.salesforce.com/s/articleView?id=platform.customize_functions_vlookup.htm&release=264.0.0&type=5 "Returns a value by looking up a related value on a custom object similar to the VLOOKUP() Excel function. This function is only available in validation rules.") | Returns a value by looking up a related value on a custom object similar to the VLOOKUP() Excel function. |

- **[All Formula Operators and Functions](https://help.salesforce.com/s/articleView?id=platform.customize_functions_parent.htm&release=264.0.0&type=5)**  
    Use 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.

#### See Also

- [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.")
- [Considerations for the Time Custom Field Type](https://help.salesforce.com/s/articleView?id=platform.custom_field_time_overview.htm&release=264.0.0&type=5 "Track time, unbound to a date, with the Time custom field type, which is useful for time management, event planning, and project management.")