ExcelFlux

STOCKHISTORY function

Retrieves historical data about a financial instrument and loads it as an array.

Information · Guided Excel example

Where can you use it?

Workbook and data quality owners. Use functions that inspect cell type, errors or the calculation environment when validating a report.

Scenario in the workbook

Retrieve historical closing prices with a supported Microsoft 365 account. Keep the two-column spill area clear.

A worked example from the workbook

RowA
6Input
7MSFT
8AAPL
9IBM
Record 1
=STOCKHISTORY(A7,DATE(2024,1,2),DATE(2024,1,4),0,1,0,1)

Illustrative outputDate and close

See the inputs and instructions for all 3 examples

Worked examples

Retrieve historical closing prices with a supported Microsoft 365 account. Keep the two-column spill area clear.

Column F provides expressions as text. Satisfy the stated requirements, then paste into an empty Excel cell and compare with column G. The result was not verified in desktop Excel here.

Row A
6 Input
7 MSFT
8 AAPL
9 IBM
Trial Expression Sample output
Record 1 =STOCKHISTORY(A7,DATE(2024,1,2),DATE(2024,1,4),0,1,0,1) Date and close
Record 2 =STOCKHISTORY(A8,DATE(2024,1,2),DATE(2024,1,4),0,1,0,1) Date and close
Record 3 =STOCKHISTORY(A9,DATE(2024,1,2),DATE(2024,1,4),0,1,0,1) Date and close

If the result is missing

Closing prices are limited to trading dates. Check the subscription, ticker and spill area.

Microsoft Excel reference