STOCKHISTORY function
Retrieves historical price data (close, open, high, low, volume) for a stock, fund, index or currency pair from the internet as a spilled table.
Available in Microsoft 365 only (Windows, Mac and Excel for the web) with an internet connection; requires a Microsoft 365 subscription
Microsoft 365 onlyNot in Google Sheets
Syntax
STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [property0], [property1], ...)| Argument | What it means | |
|---|---|---|
stock | Required | Ticker symbol in quotes such as "MSFT", an exchange-qualified code like "XNAS:MSFT", or a cell with the Stocks data type. |
start_date | Required | First date to retrieve. |
end_date | Optional | Last date. Default: same as start_date. |
interval | Optional | 0 = daily (default), 1 = weekly, 2 = monthly. |
headers | Optional | 0 = no headers, 1 = show a header row (default), 2 = show the instrument name and headers. |
property0, ... | Optional | Which columns to return and in what order: 0 Date, 1 Close, 2 Open, 3 High, 4 Low, 5 Volume. Default: Date and Close. |
Returns: A dynamic array (spilled table) of dates and prices.
How STOCKHISTORY works
STOCKHISTORY downloads historical market data straight into your sheet. Give it a ticker and a date range and it spills a table of dates and closing prices; add arguments to switch to weekly or monthly data and to request open, high, low and volume columns. It is ideal for charting a share's performance, comparing two funds, or tracking an exchange rate such as "USD/EUR" over time.
The data comes from an online provider (Refinitiv/LSEG), so it needs a connection and can update when the workbook recalculates. Only trading days appear in daily data, so weekends and market holidays are skipped. Prices are in the instrument's own currency and may be delayed; Microsoft notes the data is for information, not trading. Because the result spills, keep the cells below and to the right empty.
The numbers shown in the examples below depend on the market, so the results describe what Excel returns rather than exact prices.
Examples
1Daily closing prices for one week
| A | B | C | |
|---|---|---|---|
| 1 | Ticker | From | To |
| 2 | MSFT | 2026-11-02 | 2026-11-06 |
| 3 | |||
| 4 | A 2-column table: a header row (Date, Close) and one row per trading day from 2 to 6 Nov 2026 — 6 rows in total, with prices from the live data feed |
Result: A 2-column table: a header row (Date, Close) and one row per trading day from 2 to 6 Nov 2026 — 6 rows in total, with prices from the live data feed
With only the required arguments you get daily data, a header row and the default Date and Close columns. Format the Date column as dates if Excel does not do so automatically.
2Monthly open, high, low and close
| A | B | C | |
|---|---|---|---|
| 1 | Ticker | From | To |
| 2 | XNAS:MSFT | 2026-01-01 | 2026-06-30 |
| 3 | |||
| 4 | A 5-column table (Date, Open, High, Low, Close) with a header row and one row per month, January to June 2026 |
Result: A 5-column table (Date, Open, High, Low, Close) with a header row and one row per month, January to June 2026
interval 2 returns monthly bars; headers 1 keeps the header row; properties 0, 2, 3, 4, 1 choose the columns and their order.
3Latest close only, no headers
| A | B | |
|---|---|---|
| 1 | Ticker | Last close |
| 2 | MSFT | A single number: the closing price of the most recent trading day in the last seven days |
Result: A single number: the closing price of the most recent trading day in the last seven days
headers 0 and property 1 return just a column of closing prices, listed oldest first. TAKE with −1 keeps only the last row, the latest close. INDEX(...,1) would instead return the oldest price of the week.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#BLOCKED! / #CONNECT! | No internet connection, or the service is unavailable or blocked by your organisation. | Check the connection and try again later. |
#VALUE! | Unknown ticker, invalid dates, or an invalid property code. | Check the symbol (add the exchange code, e.g. XLON:VOD) and the arguments. |
#SPILL! | Cells in the spill range are not empty. | Clear the area below and to the right of the formula. |
Tips
- Use exchange-qualified codes such as
"XNYS:KO"or"XLON:BP."to avoid ambiguous tickers. - Currency pairs work too:
=STOCKHISTORY("EUR/USD",start,end). - The workbook needs Microsoft 365 to refresh; in older versions the spilled values stay but cannot update.
Google Sheets
Use GOOGLEFINANCE(ticker, "close", start_date, end_date, "DAILY") for historical prices.
STOCKHISTORY in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | AKTIEHISTORIK |
| Dutch | AANDELENGESCHIEDENIS |
| Finnish | OSAKEHISTORIA |
| Hungarian | RÉSZVÉNY.ELŐZMÉNYEK |
| Norwegian (Bokmål) | AKSJEHISTORIKK |
| Polish | HISTORIA.AKCJI |
| Portuguese (Portugal) | HISTÓRICODEAÇÕES |
| Russian | ИСТОРИЯАКЦИЙ |
| Turkish | STOKGEÇMİŞİ |