---
schema_version: "1"
id: 509e7053852b009ac78b3c3bf9bb3b464304b7b0c8b8080b5858a8aacda661d4
title: days_ago
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_function_ref_days_ago.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_days_ago.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 5ea4be6fe504f9be2267cc1764c0c0b019887a7ab2000a2543906bd60d4629fa
description: Returns the date that's a specified number of days before another date in Salesforce Spiff.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# days\_ago

Returns the date that's a specified number of days before another date in Salesforce Spiff.

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

```
days_ago(start_date, number_of_days)
```

## Arguments

  
| Argument | Required? | Description |
| --- | --- | --- |
| start\_date | Required | The Date or Date & Time value to evaluate. This argument supports any date functions. To specify a date as a string in YYYY-MM-DD format, use the `date()` function and enclose the string in double quotes. |
| number\_of\_days | Required | An integer that specifies the number of days ahead or behind to find the date for. Positive values count days in the past, and negative values count days in the future. |

## Example

Return the date that's 14 days before a deal's close date.

```
=days_ago(CloseDate, 14)
```

Return the date that's 14 days after a deal's close date.

```
DaysAgo = days_ago(CloseDate, -14)
```

Return the date 10 days after the start of the statement period.

```
=days_ago(statement_period.start_date, 10)
```

Return the last day of the previous statement period, or done day before the current statement period.

```
=days_ago(statement_period.start_date, 1)
```

Return the date 30 days ago from a text-formatted date.

```
=days_ago(date("2024-03-31"), 30)
```

#### See Also

- [date](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_date.htm&release=264.0.0&type=5 "Converts a string into a Date data type in Salesforce Spiff. This function finds the date value for a field that isn't specifically a Date data type so that Spiff can use the date value in calculations and other functions related to dates.")