STOCKHISTORY function in Excel
Retrieves historical data about a financial instrument and loads it as an array
=STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [property0], [property1], [property2], [property3], [property4], [property5])STOCKHISTORY syntax and parameters
11 arguments, two required.
- stockanyRequired
Function returns historical price data about the financial instrument corresponding to this value. Enter a ticker symbol in double quotes (e.g., "MSFT") or a reference to a cell containing the Stocks data type. This will pull data from the default exchange for the instrument. You can also refer to a specific exchange by entering a 4-character ISO market identifier code (MIC), followed by a colon, followed by the ticker symbol (e.g., "XNAS:MSFT"). Learn more about our data sources.
- start_dateanyRequired
The earliest date for which data is retrieved. Note that if interval is not 0 (daily), the first data point may be earlier than the start_date provided - it will be the first date of the period requested.
- end_dateanyOptional
Optional. The latest date for which data will be retrieved. Default is start_date.
- intervalnumberOptional
Optional. Specifies the interval each data value represents as follows:0 = daily, 1 = weekly, 2 = monthly.Default is 0.
- headersnumberOptional
Optional. Specifies whether to display headings as follows:0 = no headers, 1 = show headers, 2 = show instrument identifier and headers.Default is 1 (i.e, show headers). When included, headers are rows of text that are part of the array returned from the function.
- property0anyOptional
- property1anyOptional
- property2anyOptional
- property3anyOptional
- property4anyOptional
- property5anyOptional
STOCKHISTORY examples
Formulas you'll actually reuse.
Monthly closes for the first half of the year (interval 2 = monthly):
=STOCKHISTORY("MSFT", DATE(2026, 1, 1), DATE(2026, 6, 30), 2)Thirty days of daily highs and lows, no headers (properties 2 and 3):
=STOCKHISTORY("MSFT", TODAY() - 30, TODAY(), 0, 0, 0, 2, 3)
STOCKHISTORY in Google Sheets
No direct equivalent — here's the way around.
Try STOCKHISTORY in the playground
Edit the example — nothing to install.
Preloaded with the STOCKHISTORY formula from Example 1 — change anything and watch it respond.
STOCKHISTORY errors
What they mean — and the fixes.
#VALUE!The ticker isn't recognised or the end date is before the start date — try the exchange-qualified form such as "XNAS:MSFT".
Related functions
More ways Excel gets this done.
- CELLReturns information about the formatting, location, or contents of a cellThis function is not available in Excel for the web.InfoGoogle Sheets
- ERROR.TYPEReturns a number corresponding to an error typeInfoGoogle Sheets
- INFOReturns information about the current operating environmentThis function is not available in Excel for the web.InfoNo Google Sheets equivalent
- ISBLANKReturns TRUE if the value is blankInfoGoogle Sheets
- ISERRReturns TRUE if the value is any error value except #N/AInfoGoogle Sheets
- ISERRORReturns TRUE if the value is any error valueInfoGoogle Sheets