SUM Function: Calculate the Total of Numeric Values

Article Number:040807

You can sum numeric values by using the SUM function in a formula.
The SUM function can be used to sum the values entered in multiple "Number" fields, or to add up time data or numeric values entered in a table.

SUM Function Syntax

The content has been copied.
SUM(number1, [number2], ...)

SUM functions need to have at least one numeric argument specified.
"Number 2" and additional arguments are optional.

For a numeric argument (e.g., "number1," "number2"), you can specify a numeric value, the field code of a "Number" field, or a formula that produces a numeric value.

Formula Examples

When specifying a field in a formula, make sure to specify the field code as the argument (and not the field name).
In the examples below, the field code is set for each field as the field name with underscores instead of spaces (e.g., the field code for the "Transportation cost" field is "Transportation_cost").

Formula to Sum the Values of Multiple Fields

The following formula sums the values of three "Number" fields: "Transportation cost," "Lodging cost," and "Daily allowance." (Their field codes are "Transportation_cost," "Lodging_cost," and "Daily_allowance," respectively.)

The content has been copied.
SUM(Transportation_cost, Lodging_cost, Daily_allowance)

Screenshot: A record where the sum of multiple field values is calculated The "Total" field set with this formula displays "400," which is the sum of "270" in the "Transportation cost" field, "120" in the "Lodging cost" field, and "10" in the "Daily allowance" field.

Formula to Sum Numeric Values in a Table

The following formula sums the numeric values entered in the "Calculated" field named "Subtotal" in a table. (The field name and field code are the same.)

The content has been copied.
SUM(Subtotal)

Screenshot: A record where the sum of values in the "Subtotal" field is calculated For information on how to set this formula, refer to Example: Calculating the Sum of Subtotals in a Table.

Formula to Sum Time Data in a Table

The following formula sums the time data entered in the "Calculated" field named "Duration" in a table. (The field code is "Duration".)

The content has been copied.
SUM(Duration)

Screenshot: A record where the sum of inquiry durations is calculated For details on how to set this formula, refer to Example: Calculate the Total of Time Data in a Table.