---
schema_version: "1"
id: 0e2eafff5d799843271dac29ee356f9cd8dd496fe995fe595fb55d2716184feb
title: sum
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_function_ref_sum.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_sum.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 57bfd82a777c7b48d6adf99280162295ac41dcf1df996cb7aa0199ac32afa057
description: Calculates a total value from a list of numbers in Salesforce Spiff. This function works well with records in a data filter.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# sum

Calculates a total value from a list of numbers in Salesforce Spiff. This function works well with records in a data filter.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available for an additional cost in: <strong>Professional</strong> Edition with Web Services API Enabled</td></tr></tbody></table>

## Syntax

The syntax and arguments change depending on the input data.

```
sum(list_or_range)
```

```
sum(filter!column_or_field)
```

```
sum(filter, condition, column_or_field)
```

## Arguments

  
| Argument | Required? | Description |
| --- | --- | --- |
| list\_or\_range | Required if summing a list | The list or range to sum. Enclose a list in brackets with comma-separated values. |
| filter | Required if summing a data filter | The data filter with records that you want to sum. |
| column\_or\_field | Required if summing a data filter | An expression that specifies the column or field from the filter's records that you want to sum. |
| condition | Optional | An expression that specifies a condition that must be true for the function to calculate a sum. If you specify a condition, it must be the second argument. |

## Considerations

This function supports an optional condition, but we recommend that you use the `sumif()` function instead for sums that include a condition. The `sumif()` function better describes the result of the formula that uses it, which is useful for internal accountability.

## Example

Sum a list of numbers.

```
=sum([1, 2, 3])
```

Sum the value of the ARR\_\_c field from records in the ClosedInPeriod data filter.

```
=sum(ClosedInPeriod!ARR__c)
```

Sum the value of the ARR\_\_c field, but only if the ARR\_\_c value is greater than $25,000.

```
=sum(ClosedInPeriod, ARR__c > 25000, ARR__c)
```

Sum the value of the TotalContractValue field, but only if the ARR\_\_c value is greater than $25,000.

```
=sum(ClosedInPeriod, ARR__c > 25000, TotalContractValue)
```

#### See Also

- [sumif](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_sumif.htm&release=264.0.0&type=5 "Calculates a total value from a list of numbers in Salesforce Spiff, but only for records that satisfy a specified condition.")