Syntax
=STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [property0], arg7, ...)Arguments
| Argument | Required | Description |
|---|---|---|
stock | Required | The ticker symbol |
start_date | Required | The first date |
end_date | Optional | The last date |
interval | Optional | 0 daily, 1 weekly, 2 monthly |
headers | Optional | 0 none, 1 headers, 2 headers and identifier |
property0 | Optional | Columns 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 Related web functions
- GOOGLEFINANCEGets current or past stock market data. Live web data is not available yet, so this returns #BLOCKED!.
- HYPERLINKCreates a link that opens a web page or a place in the workbook when clicked.
- IMAGEShows a picture from a web address inside the cell.
- IMPORTDATAImports a CSV or TSV file from a web address. Live web data is not available yet, so this returns #BLOCKED!.
- IMPORTFEEDImports an RSS or Atom feed. Live web data is not available yet, so this returns #BLOCKED!.
- IMPORTHTMLImports a table or list from a web page. Live web data is not available yet, so this returns #BLOCKED!.
- IMPORTRANGEImports a range from another spreadsheet. Live web data is not available yet, so this returns #BLOCKED!.
- IMPORTXMLImports data from a web page using an XPath query. Live web data is not available yet, so this returns #BLOCKED!.
- WEBSERVICEReads data from a web service. Web access is turned off for safety, so this returns #BLOCKED!.