logo
search
Function Problems

How to Retrieve a Stock Price for a Specific Historical Date in Excel

Maira MehtabMaira Mehtab Sep 20, 2026 869 views

Question details

The user needs to retrieve stock prices for specific historical dates using an Excel formula, but encounters failures when the requested date is a non-trading day.

Product
Microsoft Excel
Device & OS
not provided
Scenario
Using Excel's built-in stock functions to fetch historical financial data for specific calendar dates.
Observed behavior
The formula fails or returns an error for dates that do not match active trading days, such as weekends and market holidays, because no stock price data is available.
Before you start

Verify that the specific historical date you are querying was an active market trading day, as stock exchanges are closed on weekends and official financial holidays.

Solution 1Recommended

Adjust the Target Date to a Valid Trading Day

Ensure the requested date is a valid market trading day, as stock prices do not exist for weekends or market holidays.

Excel's stock data features rely on official market data. If you query a date when the stock exchange was closed, the formula will return an error because no trading occurred.

1
Verify the Historical Date

Check a calendar to ensure the date you are querying does not fall on a Saturday, Sunday, or a recognized stock market holiday.

2
Use the WORKDAY Function

Modify your date cell using the WORKDAY function (e.g., =WORKDAY(A2, -1)) to automatically find the nearest previous trading day if your target date falls on a weekend.

3
Re-enter the Stock Formula

Apply your STOCKHISTORY formula referencing the newly adjusted valid trading date to successfully retrieve the historical price.

Account for Market Holidays: Remember to account for specific market holidays (like Thanksgiving or Christmas) when using date adjustments, as the WORKDAY function does not automatically exclude them unless specifically listed in its parameters.
Free Microsoft Office alternative

Use WPS Office for Reliable Financial Data Management

If you are experiencing ongoing data retrieval bugs with built-in data types in Excel, consider switching to WPS Office. WPS Spreadsheets offers a robust, free alternative for managing financial datasets, analyzing imported historical stock data, and building complex financial models without relying on problematic native integrations.

  1. 1. Download and Install WPS Office: Get the free WPS Office suite from the official website and install it on your device.
  2. 2. Open Your Financial Workbook: Launch WPS Spreadsheets and open your existing .xlsx file containing your financial data.
  3. 3. Import Reliable Stock Data: Use the 'Data' tab to import historical stock CSV files directly from reliable financial sources like Yahoo Finance, avoiding native formula bugs.
Highly compatible with Microsoft Excel (.xlsx) files and standard financial formulas.Easily import historical stock data via CSV without native data-type errors.Lightweight, fast, and completely free to use for everyday spreadsheet tasks.Familiar user interface ensuring a seamless migration from Microsoft Office.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the STOCKHISTORY formula return an error?

This typically happens if the requested date falls on a weekend, a market holiday, or if the stock ticker symbol is misspelled. Ensure the queried date is a valid trading day.

Can I get historical stock prices for weekends in Excel?

No, stock exchanges are closed on weekends. You must adjust your formula to fetch the closing price from the Friday before the weekend.

How do I find the nearest trading day for an Excel stock formula?

You can use the WORKDAY function in Excel to automatically adjust a weekend date to the nearest previous or next valid trading day before pulling the stock price.

What should I do if a valid trading date still shows no stock data?

This may be a bug in Excel's data detection. You can report the issue through the Excel Help menu or consult the Excel Management Microsoft Q&A forum for community support.