Skip to content
Excel

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.

  1. Monthly closes for the first half of the year (interval 2 = monthly):

    =STOCKHISTORY("MSFT", DATE(2026, 1, 1), DATE(2026, 6, 30), 2)
  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.

Loading the editor…

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".