# SUM Function: Calculate the Total of Numeric Values

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

`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."

`SUM(Transportation_cost, Lodging_cost, Daily_allowance)`

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.

Place a "Calculated" field or a "Text" field outside the table and specify the following formula.

`SUM(Subtotal)`

The "Total" field in which this formula is set displays the sum of the "Subtotal" field values.

### 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.

Place a "Calculated" field outside the table, specify the following formula in it, and set the calculation result to display a time.

`SUM(Duration)`

The "Total Service Time" field in which this formula is set displays the sum of the "Service Time" field values.