1. Home
  2. Functions
  3. Web
  4. STOCKHISTORY

STOCKHISTORY function

Gets the price history of a stock. Live web data is not available yet, so this returns #BLOCKED!.

Syntax

=STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [property0], arg7, ...)

Arguments

ArgumentRequiredDescription
stockRequiredThe ticker symbol
start_dateRequiredThe first date
end_dateOptionalThe last date
intervalOptional0 daily, 1 weekly, 2 monthly
headersOptional0 none, 1 headers, 2 headers and identifier
property0OptionalColumns to return

How to use STOCKHISTORY

This function reads data from outside the workbook, so its result depends on what the source returns when the sheet calculates.

STOCKHISTORY takes 3 required arguments and 3 optional arguments, and accepts more values in the same pattern. Type =STOCKHISTORY( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=STOCKHISTORY("MSFT", 45000)Result #BLOCKED!

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.