---
schema_version: "1"
id: 0a198b7d973383217401f24b2c8c9ac8a16820dc109375ed87c442af7dca5075
title: months_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_months_ago.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_months_ago.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ca449fb6e67bcf12b44ba72d942c8a38bba5afe4af0bce9a0d0138b1436ca64f
description: Returns the date that's a specified number of months before another date in Salesforce Spiff.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# months\_ago

Returns the date that's a specified number of months 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

```
months_ago(start_date, number_of_months)
```

## Arguments

  
| Argument | Required? | Description |
| --- | --- | --- |
| start\_date | Required | The date 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\_months | Required | An integer that specifies the number of months ahead or behind to find the date for. Positive values count months in the past, and negative values count months in the future. |

## Considerations

To return the last day of the previous month, use the `days_ago()` function instead.

## Example

Return the date that's three months before the statement period.

```
=months_ago(statement_period.start_date, 3)
```

Return the date that's three months after the statement period.

```
=months_ago(statement_period.start_date, -3)
```

Return the date at the beginning of the previous quarter.

```
=months_ago(beginning_of_quarter(statement_period.start_date), 3)
```

Return the date at the end of the previous quarter.

```
=months_ago(end_of_quarter(statement_period.start_date), 3)
```

Return the start date three quarters ago. For the February statement period, the start date three quarters ago was April 1 of the previous year.

```
=months_ago(beginning_of_quarter(statement_period.start_date), 9)
```

#### See Also

- [days\_ago](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_days_ago.htm&release=264.0.0&type=5 "Returns the date that's a specified number of days before another date in Salesforce Spiff.")