> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Sum

> Use the Sigma Sum function to add the numerical values in a column or group.

The **Sum** function adds the numerical values in a column or group.

The **Sum** function is an aggregate function.

Aggregate functions evaluate one or more rows of data and return a single value.

In a table element, the aggregate is calculated for each grouping. For information on how to add a grouping with an aggregate calculation to a table, see [Group columns in a table](/docs/create-and-manage-tables#group-columns-in-a-table).

In a table with no groupings, the aggregate is calculated for each row. For information on how to calculate summary statistics across all rows in a table, see [Add summary statistics to a table](/docs/create-and-manage-tables#add-summary-statistics-to-a-table).

To learn more about using aggregate functions, see [Building complex formulas with grouped data](https://www.sigmacomputing.com/resources/training-videos/table-grouping-and-functions#complex-formulas).

## Syntax

`Sum(column)`

Function arguments:

* **column** (required) - The column of numbers to add together. Any Null or empty values are skipped.

## Notes

* The sum function is different from the numeric operator `+` in that it adds all of the values in a column or group, rather than adding multiple values together in the same calculation. For more information, see [Operators overview](/docs/operators-overview)
* To return the sum of an entire column as an aggregate in each row, use the [GrandTotal](/docs/grandtotal) function with the sum function as the argument. For example, `GrandTotal(Sum([Cost]))` returns the sum of the `[Cost]` column as a value in each row, which can be used to compare the `[Cost]` in each row to a total cost.

## Examples

```
Sum([Price]) - Sum([Cost])
```

* In a table summary, finds the total profit for all rows in the table by subtracting the sum of *Cost* from the sum of *Price*.
* In a calculated column, finds the profit for each row by subtracting *Cost* from *Price*.
* In a grouped table, finds the profit for each group by subtracting the sum of *Cost* from the sum of *Price* for each group.

```
Sum([Profit])
```

* In a table summary, returns the total *Profit* for all rows in the table.
* In a calculated column, returns the *Profit* for each row.
* In a grouped table, finds the total *Profit* for each group.

If *Profit* contains values 2, 4, 6, 8, and 10, returns `30` when used in a table summary.

```
GrandTotal(Sum([Cost]))
```

In a calculated column, returns the total of *Cost* in each row of the table.

## Related resources

* [SumIf](/docs/sumif)
* [MovingSum](/docs/movingsum)
* [CumulativeSum](/docs/cumulativesum)
* [SumProduct](/docs/sumproduct)