---
schema_version: "1"
id: 1bfe7ee85a02dd78160fe6a7f65d9e982849aa98b8a0069657c485b6d533a904
title: Functions for Calculation Procedures (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_functions_for_calculation_procedures.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_functions_for_calculation_procedures.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d319b52343cb678b695024a088931314359b7831cceb780c55c771acba6b6790
description: For the managed package runtime, the following functions are supported in calculation procedures.
products:
  - Omnistudio
release: "264"
---
# Functions for Calculation Procedures (Managed Package)

For the managed package runtime, the following functions are supported in calculation procedures.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col>
          <col>
          <col>
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d287118e48">
              <p style="margin-bottom:0;">Function</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d287118e54">
              <p style="margin-bottom:0;">Description</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d287118e60">
              <p style="margin-bottom:0;">Example</p>
            </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">ADDDAY</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Adds the specified number of days to the specified date and returns the resulting date.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">ADDDAY("1999-01-01",100) returns "1999-04-11 00:00:00"</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">ADDMONTH</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Adds the specified number of months to the specified date and returns the resulting date.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">ADDMONTH("1999-01-01",100) returns "2007-05-01 00:00:00"</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">ADDYEAR</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Adds the specified number of years to the specified date and returns the resulting date.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">ADDYEAR("1999-01-01",100) returns "2099-01-01 00:00:00"</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">AGE</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Returns the age for the specified birthdate.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">AGE(Account:Contact:Birthdate)</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">AGEON</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Given a birth date, returns the age on a specified date</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">AGEON(Account:Contact:Birthdate,TODAY()).</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">DATEDIFF</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Returns the number of days between two specified dates. If the first date is greater than the second date, the value is returned as a negative number.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p>DATEDIFF("1900-01-01","2000-01-01") returns 36524</p>
              <p>DATEDIFF("2000-01-01","1999-01-01") returns -365</p>
              <p style="margin-bottom:0;">DATEDIFF(Account:Cases:CreatedDate,TODAY()) returns the number of days a case has been open</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">EOM</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">For a specified date, returns the date of the last day of the month.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">EOM(Account:CaseReturns the month of the specified date as an integer. s:CreatedDate)</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">MONTH</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">For a specified date, returns the month as an integer (1-12).</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">MONTH("1999-01-11") returns 1</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">ROUND</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p>Rounds the specified number or expression. By default, results are rounded to two decimal places, but you can specify the desired number of decimal places for the result.</p>
              <p style="margin-bottom:0;">
                You can also use the UP, DOWN, HALF_UP, HALF_DOWN, HALF_EVEN, CEILING, and FLOOR parameters to refine the rounding results.
              </p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p>ROUND(3.1415 * 3) = 9.42</p>
              <p style="margin-bottom:0;">ROUND(3.1415 * 3, 0) = 9</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">FLOOR</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;" id="os_functions_for_calculation_procedures__UUID-55a8f940-4032-7ce8-8f72-1ed74dc5fedc_para-idm263312723904294"><a name="os_functions_for_calculation_procedures__UUID-55a8f940-4032-7ce8-8f72-1ed74dc5fedc_para-idm263312723904294"><!-- --></a>Use with ROUND to specify that the rounding result is rounded down (towards zero) to the nearest integer.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">ROUND(3.1415, 0, FLOOR) = 3</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">UP</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Use with ROUND to specify that the rounding result is rounded up (away from zero).</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">ROUND(2.572, 2, UP) returns 2.58</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">DOWN</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Use with ROUND to specify that the rounding result is rounded down (towards zero).</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">ROUND(2.572, 2, DOWN) returns 2.57</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">HALF_UP</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Use with ROUND to specify that the rounding result is rounded towards the nearest neighbor (up or down) unless the neighbors are equidistant, in which case it rounds up.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">ROUND(2.575, 2, HALF_UP) returns 2.58</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">HALF_DOWN</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Use with ROUND to specify that the rounding result is rounded rounded towards the nearest neighbor (up or down) unless the neighbors are equidistant, in which case it rounds down.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">ROUND(2.575, 2, HALF_DOWN) returns 2.57</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">HALF_EVEN</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p>Use with ROUND to specify that the rounding result is rounded rounded towards the nearest neighbor (up or down) unless the neighbors are equidistant, in which case it rounds to the nearest even neighbor.</p>
              <p style="margin-bottom:0;">Behaves as for ROUND HALF_UP if the digit to the left of the discarded fraction is odd; behaves as for ROUND HALF_DOWN if it is even.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">ROUND(2.57, 1, HALF_EVEN) returns 2.6, which is rounded up to the nearest even one-decimal place.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">CEILING</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;" id="os_functions_for_calculation_procedures__UUID-55a8f940-4032-7ce8-8f72-1ed74dc5fedc_para-idm263312723992868"><a name="os_functions_for_calculation_procedures__UUID-55a8f940-4032-7ce8-8f72-1ed74dc5fedc_para-idm263312723992868"><!-- --></a>Use with ROUND to specify that the rounding result is rounded up (away from zero) to the nearest integer.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;" id="os_functions_for_calculation_procedures__UUID-55a8f940-4032-7ce8-8f72-1ed74dc5fedc_para-idm263312724053584"><a name="os_functions_for_calculation_procedures__UUID-55a8f940-4032-7ce8-8f72-1ed74dc5fedc_para-idm263312724053584"><!-- --></a>ROUND(3.1415, 0, CEILING) = 4</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">SQRT</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Calculates the square root of a value.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">SQRT(12 * 3) returns 6</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">TODAY</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Returns today's date</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">&nbsp;</td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e48 ">
              <p style="margin-bottom:0;">YEAR</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e54 ">
              <p style="margin-bottom:0;">Returns the year of the specified date as an integer.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e60 ">
              <p style="margin-bottom:0;">YEAR("1999-01-11") returns 1999</p>
            </td>

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

For looping procedures: PREVIOUS

For aggregation steps, the following functions are supported.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
          <col style="width:33.33333333333333%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d287118e506">
              <p style="margin-bottom:0;">Function</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d287118e512">
              <p style="margin-bottom:0;">Description</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d287118e518">
              <p style="margin-bottom:0;">Example</p>
            </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e506 ">
              <p style="margin-bottom:0;">AVG</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e512 ">
              <p style="margin-bottom:0;">Average of list of values.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e518 ">
              <p style="margin-bottom:0;">AVG(1,2,3,4,5,6,7,8,9,10) returns 5.5</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e506 ">
              <p style="margin-bottom:0;">MAX</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e512 ">
              <p style="margin-bottom:0;">Maximum value in a list of values.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e518 ">
              <p style="margin-bottom:0;">MAX(1,2,3,4,5,6,7,8,9,10) returns 10</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e506 ">
              <p style="margin-bottom:0;">MIN</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e512 ">
              <p style="margin-bottom:0;">Minimum value in a list of values.</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e518 ">
              <p style="margin-bottom:0;">MIN(1,2,3,4,5,6,7,8,9,10) returns 1</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e506 ">
              <p style="margin-bottom:0;">SUM</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e512 ">
              <p style="margin-bottom:0;">Returns the sum of a list of values</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d287118e518 ">
              <p style="margin-bottom:0;">SUM(1,2,3,4,5,6,7,8,9,10) returns 55</p>
            </td>

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