Skip to main content
← All functions

STOCKHISTORY function

Retrieve a series of historical security prices in supported Excel.

The browser lab uses an explicitly attached fictional or locally imported calendar to explore dates, property order and spilled arrays. Native Excel retrieves historical securities data through an eligible Microsoft 365 data service; that service and native provider behavior are not certified by this lab.

Syntax

STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [property0], [property1])

Square brackets indicate optional arguments.

Arguments

ArgumentRequiredMeaning
stockYesA supported ticker or linked security identifier.
start_dateYesThe first requested date, stored as an Excel date value.
end_dateNoThe last requested date. If omitted, it defaults to start_date.
intervalNo0 = daily (default), 1 = weekly, 2 = monthly. The attached lab declares its own market-week start; native provider calendars remain separate.
headersNo0 = no headings, 1 = column headings (default), 2 = instrument identifier and headings.
property0No0 = Date, 1 = Close, 2 = Open, 3 = High, 4 = Low, 5 = Volume. If all properties are omitted, Date and Close are returned.
property1No · repeatsRequest further property numbers in the desired order, including repeated fields; up to six properties in total.

Explore historical observations from an attached source

Use original fictional observations or attach your own complete calendar locally. No market service is queried. Native Excel STOCKHISTORY uses a separate Microsoft 365 data service.

The attached fictional calendar returns open sessions only. Closed sessions are declared in the source and do not become zero-price rows.

Synthetic Alpha · XDEM:CW-A · original fictional data · 2024-01-01 through 2024-02-11 · 42 declared calendar days, 28 open sessions.

Inspect or replace the source calendar

Include every civil date. Use open or closed in State; leave closed observations blank. In open sessions use plain finite numbers or explicit NA for unavailable observations. Prices may be negative; volume cannot. CSV and tab-separated UTF-8 files are accepted, up to 1,462 dates and 256 KiB.

The attached market week is declared by the source. This lab expands the initial period and clips observations at end_date; native provider calendars, partial-period handling, linked Stocks values and formatting hints remain separate verification work.

Reference and compatibility

Original SheetTutor reference notes / Microsoft documentation. Calculation checks cover the supplied examples only. The browser worksheet does not implement every Excel feature, external service or connected data type.