logo
search
Function Problems

How to Fix Excel STOCKHISTORY Errors (#CALC!, #CONNECT!)

Tauseeq MagsiTauseeq Magsi Sep 25, 2026 870 views

Question details

Users are experiencing errors or receiving incorrect stock symbol results when utilizing the STOCKHISTORY function in large workbooks.

How to Fix Excel STOCKHISTORY Errors and Incorrect Stock Results
Product
Microsoft Excel
Device & OS
Mac
Scenario
Pulling historical stock data and exchange rates using the dynamic STOCKHISTORY function in financial workbooks.
Observed behavior
The function returns various error codes such as #CALC!, #CONNECT!, #SPILL!, #N/A, and #UNKNOWN!, or intermittently fetches quotes for the wrong stock symbol.
Before you start

Ensure you have a stable internet connection and that you are logged into a Microsoft 365 account, as the STOCKHISTORY function relies on live cloud services to fetch financial data.

Solution 1Recommended

Format the Ticker Input Cell as a Stock Data Type

Formatting the cell containing the stock symbol as a Stock data type allows Excel to correctly identify the specific company and financial exchange, resolving #CALC! and #UNKNOWN! errors.

Often, errors occur because the ticker symbol is supplied through a variable or standard text cell, causing Excel to misinterpret the exchange or company. Explicitly assigning the Stock data type forces Excel to validate the symbol.

1
Select the ticker cell

Click on the cell that contains your stock ticker symbol (e.g., AAPL).

2
Navigate to the Data tab

Go to the 'Data' tab on the Excel ribbon menu.

3
Apply the Stock data type

In the 'Data Types' group, click on 'Stocks'. Wait a moment for Excel to link the text to the financial data source. A small bank or building icon will appear next to your symbol.

Format the Ticker Input Cell as a Stock Data Type
Data Type Validation: Once the cell is formatted as a Stock data type, your STOCKHISTORY formula referencing this cell should automatically refresh and display the correct historical data.
Free Microsoft Office alternative

Try WPS Office for Reliable Spreadsheet Management

If frequent cloud service disruptions and dynamic array errors in Microsoft Excel are slowing down your workflow, consider switching to WPS Office. It offers a powerful, lightweight, and completely free spreadsheet application that supports all your data analysis needs without the hassle.

  1. 1. Download and Install: Visit the official WPS website to download the free suite for your device.
  2. 2. Open your Excel files: Launch WPS Spreadsheet and open your existing .xlsx financial workbooks seamlessly.
  3. 3. Analyze your data: Use built-in functions, charts, and pivot tables to continue your data analysis without interruption.
Fully compatible with Microsoft Excel formats (.xlsx, .xls, .csv)Stable offline performance for reliable spreadsheet analysis without cloud dependenciesLightweight installation that runs smoothly on Mac, Windows, and LinuxFamiliar user interface requiring zero learning curve
QA img-9

Frequently Asked Questions

Why does the STOCKHISTORY function return a #CONNECT! error?

The #CONNECT! error occurs when Excel cannot establish a connection to the internet or when Microsoft's external financial data provider is experiencing a temporary outage. Check your internet connection and try refreshing the sheet later.

What causes the #CALC! error when using STOCKHISTORY?

A #CALC! error usually means the function's calculation engine encountered an issue. For STOCKHISTORY, this often happens if the specified stock exchange does not carry the requested ticker, or if the date range provided in the formula includes non-trading days where no data exists.

How do I fix the #UNKNOWN! error for a stock symbol?

The #UNKNOWN! error indicates Excel does not recognize the ticker symbol you entered. You can fix this by selecting the cell with the ticker, navigating to the Data tab, and clicking 'Stocks' to format it as a linked Stock data type, which helps Excel accurately identify the company.

Is STOCKHISTORY available in older versions of Excel?

No, STOCKHISTORY is a dynamic array function exclusive to Microsoft 365 subscribers and Excel for the Web. If you open a workbook containing this formula in a standalone version of Excel (like Excel 2019 or 2016), it will return a #NAME? error.