Practice free

STOCKHISTORY function

STOCKHISTORY pulls daily, weekly or monthly price history for a stock or fund into the sheet as a spilled table. It needs an internet connection and a qualifying subscription.

Example

=STOCKHISTORY("MSFT",DATE(2024,1,1),DATE(2024,1,31),0,1,0,1)

Expected result: n/a Not yet checked in desktop Excel

Syntax

STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [property0], [property1], [property2], [property3], [property4], [property5])

Arguments in [square brackets] are optional.

stock (required)
Ticker symbol, optionally with exchange prefix.
start_date (required)
First date to return.
end_date (optional)
Last date; defaults to start_date.
interval (optional)
0 daily, 1 weekly, 2 monthly.
headers (optional)
0 none, 1 show headers, 2 headers with ticker.
property0 (optional)
Column to return: 0 date, 1 close, 2 open, 3 high, 4 low, 5 volume.
property1 (optional)
Second column (same codes).
property2 (optional)
Third column.
property3 (optional)
Fourth column.
property4 (optional)
Fifth column.
property5 (optional)
Sixth column.

Returns: A spilled table of historical prices for the chosen security.

One STOCKHISTORY formula can fill more than one cell. When the result has several values, they spill into the cells below or to the right of the formula.

Watch out for

  • Needs live data, so results change and the function may be unavailable offline.
  • Output spills; clear the cells below and right of it.

Where it works

Excel
STOCKHISTORY is only in Excel for Microsoft 365 and Excel for the web. Microsoft 365 only and requires an internet connection and a qualifying subscription.
Google Sheets
Done with a different function: `GOOGLEFINANCE`. GOOGLEFINANCE(ticker, "close", start, end, "DAILY") returns similar history.

Part of Financial functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .