Close Price X Months Ago
Returns the closing price from a specified number of months in the past. Useful for calculating returns and comparing performance over monthly periods.
Supported Symbol Formats
| Type | Format | Example |
|---|---|---|
| US Stocks | SYMBOL | AAPL, MSFT |
| ETFs | SYMBOL | SPY, QQQ |
Parameters
| Parameter | Description | Example |
|---|---|---|
| Symbol | Stock ticker | AAPL |
| Months | Number of months ago | 3, 6, 12 |
Syntax
=close_historical_x_months_ago(Symbol, months)Parameters
symbolstringRequired
monthsnumberRequired
Returns
number
Closing price X months ago
Examples
=close_historical_x_months_ago("AAPL", 3)=close_historical_x_months_ago("MSFT", 6)=close_historical_x_months_ago("SPY", 12)=(Last("AAPL")-close_historical_x_months_ago("AAPL",3))/close_historical_x_months_ago("AAPL",3)When to Use
- Calculating month-based returns
- Comparing prices across monthly periods
- Building performance tables
- Historical analysis by month
When NOT to Use
| Scenario | Use Instead |
|---|---|
| Need specific date | Close_Historical() |
| Need YTD return | ChangePercentYTD() |
| Need 52-week change | FiftyTwoWeekChange() |
Common Issues & FAQ
What date does it use for X months ago?
It typically uses the same day of month from X months prior, or the nearest trading day.
What if the market was closed on that day?
It returns the closest previous trading day's closing price.
Related Formulas
More MarketXLS Price History formulas you can use in the same worksheet:
