STOCKHISTORY Function in Excel: Historical Share Prices

STOCKHISTORY Function in Excel: Historical Share Prices featured illustration

πŸ“Ž This article includes 1 downloadable practice file ↓

⏱ 2 min readUpdated 28 September 2026

LookupLevel: IntermediateAvailable in: Excel 365 / 2021+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. STOCKHISTORY in practice
  5. Where you will use it
  6. Worked example
  7. Mistakes people make
  8. Related functions
  9. Continue learning

STOCKHISTORY fetches daily, weekly or monthly prices for a stock or currency pair into a spill range.

Advertisement

Syntax

=STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [properties…])
Argument What it means
stock Ticker such as “XNSE:INFY” or a Stocks data type.

Examples

Example 1

=STOCKHISTORY("XNSE:TCS", TODAY()-30, TODAY())

Last month of TCS closing prices.

STOCKHISTORY in practice

Where you will use it

  • Past prices of a share
  • Monthly closing prices for analysis
  • Compare two stocks

Worked example

TickerFormulaResult
XNSE:INFY=STOCKHISTORY(A2,"2026-09-01","2026-09-30",2)(spills a price table)
XNSE:TCS=STOCKHISTORY(A3,"2026-09-01","2026-09-30",2)(spills a price table)
XNSE:RELIANCE=STOCKHISTORY(A4,"2026-09-01","2026-09-30",2)(spills a price table)

Returns a table of dates and prices (Microsoft 365, online); not calculated here.

Mistakes people make

MistakeWhat to do instead
Wrong ticker formatUse the exchange prefix, e.g. XNSE:INFY
Old ExcelNeeds Microsoft 365 and internet

WEBSERVICE

πŸ“š Part of the free Excel course: Beginner β†’ Expert Β· Try it in the Formula Lab or ask the AI Helper.

⚑ Interactive Practice Lab & Formula Tester:

Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.

πŸ“Ž Practice files for this article

  • πŸ“—
    Practice workbook: Lookup & reference17 tasks on realistic sales data β€” type your formula, the Check column turns green when it is right. Answers sheet included.
    ⬇ XLSX Β· 35 KB

Free to use for learning. Files with macros (.bas) are plain text β€” import them with Alt+F11 β†’ File β†’ Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free Β· AI can be wrong