---
schema_version: "1"
id: cb848689406571031c1afe1caa5eb3706074564f6d89a6794ba036478bf85820
title: Null and Zero in Salesforce Spiff Functions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_functions_zero.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_functions_zero.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 32ca4753d6d279a4501431b9c6eeda77cbe3e25d470f1ed1cdfd794e16a856fe
description: Some functions in Salesforce Spiff divide by zero, return null, or accept null as an argument.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# Null and Zero in Salesforce Spiff Functions

Some functions in Salesforce Spiff divide by zero, return null, or accept null as an argument.

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

## Divide by Zero

Some functions in Salesforce Spiff divide by zero, which causes an error. Save troubleshooting time later by handling these scenarios when you're creating your calculations.

The `mamount()` and `mpercent()` functions handle denominator values of `0` automatically.

For other functions, use an `if()` statement to specify an expression that executes if you anticipate that you're dividing by zero.

```
=if(Denominator = 0, 0, DividebyZeroErrorCalculation)
```

Or, use the `error()` function to return a specific message for better error handling.

```
=if(Denominator = 0, error("Enter a value and try again."), DividebyZeroErrorCalculation)
```

## Test for Null Values

Formulas that return null values can cause errors or create empty data table cells. You can test for whether a record or payout rule returns a null value.

```
isnull(field)/field = null
            field = ""
```

If the first expression returns false and the second expression returns `true`, use `field != ""` in your data filter.

## Specify Null as an Argument

To omit an argument from a function, use `null` for the argument value. For example, the `tier_payout()` function's third argument is a tiebreak value, but the function accepts up to four arguments. To ignore the tiebreak value, specify `null` for the correct argument location.

```
=tier_payout(80%, table, null, "FY2024")
```

#### See Also

- [error](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_error.htm&release=264.0.0&type=5 "Returns a custom message for a statement calculation error in Salesforce Spiff. This function stops statement calculations and helps you alert admins that information is missing or preventing the calculation from executing.")
- [if](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_if.htm&release=264.0.0&type=5 "Tests for a condition in Salesforce Spiff and returns different values depending on the outcome.")
- [mamount](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_mamount.htm&release=264.0.0&type=5 "Returns the commission total for a deal in Salesforce Spiff, based on a range table and the rep's current attainment. To return a commission rate instead, use the mpercent() function.")
- [mpercent](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_mpercent.htm&release=264.0.0&type=5 "Returns the commission rate for a deal in Salesforce Spiff, based on a range table and the rep's current attainment. To return a commission total amount instead, use the mamount() function.")
- [tier\_payout](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_tier_payout.htm&release=264.0.0&type=5 "Returns a payout amount from within an upper and lower range of values in Salesforce Spiff, based on a range table. This function returns the specified column expression for that value.")