Information functions
STOCKHISTORY
Deferred: needs an outside service
Deferred by policy: the answer needs Microsoft's market data service. DNA Calc does not run this function yet. How we measure this
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | STOCKHISTORY |
| Bulgarian | STOCKHISTORY |
| Czech | STOCKHISTORY |
| Danish | AKTIEHISTORIK |
| German | STOCKHISTORY |
| Greek | STOCKHISTORY |
| English (Australia) | STOCKHISTORY |
| English (United Kingdom) | STOCKHISTORY |
| English (United States) | STOCKHISTORY |
| Spanish | HISTORIALCOTIZACIONES |
| Estonian | STOCKHISTORY |
| Finnish | OSAKEHISTORIA |
| French | HISTORIQUE.ACTIONS |
| Hebrew | STOCKHISTORY |
| Croatian | STOCKHISTORY |
| Hungarian | RÉSZVÉNY.ELŐZMÉNYEK |
| Indonesian | STOCKHISTORY |
| Italian | STOCKHISTORY |
| Japanese | STOCKHISTORY |
| Korean | STOCKHISTORY |
| Lithuanian | STOCKHISTORY |
| Latvian | STOCKHISTORY |
| Norwegian | AKSJEHISTORIKK |
| Dutch | AANDELENGESCHIEDENIS |
| Polish | HISTORIA.AKCJI |
| Portuguese (Brazil) | STOCKHISTORY |
| Portuguese (Portugal) | HISTÓRICODEAÇÕES |
| Romanian | ISTORIC STOC |
| Russian | ИСТОРИЯАКЦИЙ |
| Slovak | STOCKHISTORY |
| Slovenian | STOCKHISTORY |
| Serbian (Latin) | STOCKHISTORY |
| Swedish | AKTIEHISTORIK |
| Thai | STOCKHISTORY |
| Turkish | STOKGEÇMİŞİ |
| Ukrainian | STOCKHISTORY |
| Vietnamese | STOCKHISTORY |
| Chinese (Simplified) | STOCKHISTORY |
| Chinese (Hong Kong) | STOCKHISTORY |
| Chinese (Traditional) | STOCKHISTORY |
Names from Microsoft's support site.
What it does
STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [property0], [property1], [property2], [property3], [property4], [property5])
STOCKHISTORY fetches historical prices for one instrument and spills them as a table of ordinary numbers and
dates. The values come from Microsoft's data provider, not from the workbook.
STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [property0], ..., [property5])
stockis a ticker in double quotes, or a cell holding a Stocks data type. To name an exchange, put its four-character market identifier code and a colon first, as in"XNAS:MSFT".start_dateis the first date requested.end_datedefaults tostart_date, so leaving it out asks for one period, not for data up to today.intervalis 0 daily (default), 1 weekly or 2 monthly.headersis 0 none, 1 headers (default), or 2 instrument identifier and headers.property0toproperty5choose the columns, in the order you list them:
| Code | Column |
|---|---|
| 0 | Date |
| 1 | Close |
| 2 | Open |
| 3 | High |
| 4 | Low |
| 5 | Volume |
The default columns are Date and Close.
Try it
DNA Calc does not run this function yet: its answer needs an outside service. In Excel you would write:
=STOCKHISTORY("MSFT",DATE(2026,1,1),DATE(2026,1,8))Quirks
- The first row can precede
start_date. Non-daily intervals report the first day of the period that holds the date. Daily and weekly rows use the first valid trading day; monthly rows use the first calendar day. - Each column is a period summary. Close is the last trading day's close, Open the first day's open, High and Low the period's extremes, Volume the total.
- Today is missing until the market closes. Data generally updates after the trading day ends.
- Some instruments have no history. Microsoft notes that many index funds and some other items offered as Stocks data types have none.
- Column order is yours. Date appears only if requested, or by default.
- Headers add a row. The default output is one row taller than the data, which matters to any formula indexing into the result.
- No formatting is applied, so cells go back to General if the formula is removed.
When the service is unavailable
Microsoft's function page does not say what happens when the service cannot be reached. Its general article
says #CONNECT! means a formula could not reach a resource it needs. A Microsoft Q&A answer, which is not official
documentation, reports that error for this function. With volatile functions such as TODAY and automatic
calculation, data refreshes in the background when the workbook opens, and editing continues meanwhile. A
subscription is also needed: Microsoft lists Microsoft 365 Personal, Family, Business Standard and Business Premium.
No failure of this function has been recorded here.
How to implement
DNA Calc does not run this function yet. It is deferred by policy, because the data comes from a back end Microsoft hosts and controls. An implementation needs:
- A licensed data feed with the same instruments, exchanges and adjustment rules.
- Period logic: trading calendars per exchange, for the first valid day of each period.
- Column assembly: an array built from
propertyorder, withheadersrows. - Asynchronous calculation with a result that can spill late, and a failure outcome such as
#CONNECT!. - Argument rules for tickers, data types, exchange prefixes and date coercion.
Answers would depend on the provider chosen, so another feed could not promise Excel's values.
Rust code
This entry has no Rust implementation yet.
No implementation has been published with a Handbook test suite for this function.
Version differences
No Excel answers for this function are recorded here, so no comparison between Excel builds exists. Microsoft's page lists Excel for Microsoft 365 on Windows and Mac. Past prices can also change at the provider, so an old answer is not a stable reference.
Alternatives
- The Stocks data type with
FIELDVALUEfor current fields. - Power Query against a data source you license, for a stored and repeatable history.
- Recording a result as values, when a report has to stay fixed.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents