STOCKHISTORY function - Microsoft Support (2024)

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web More...Less

The STOCKHISTORY function retrieves historical data about a financial instrument and loads it as an array, which will spill if it's the final result of a formula. This means that Excel will dynamically create the appropriate sized array range when you press ENTER.

Important:The STOCKHISTORY function requires a Microsoft 365 Personal, Microsoft 365 Family, Microsoft 365 Business Standard, or Microsoft 365 Business Premium subscription.

Technical details

Syntax

=STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [property0], [property1], [property2], [property3], [property4], [property5])

The STOCKHISTORY function syntax has the following arguments:

Argument

Description

stock

Function returns historical price data about the financial instrument corresponding to this value. Enter a ticker symbol in double quotes (e.g., "MSFT") or a reference to a cell containing the Stocks data type. This will pull data from the default exchange for the instrument. You can also refer to a specific exchange by entering a 4-character ISO market identifier code (MIC), followed by a colon, followed by the ticker symbol (e.g., "XNAS:MSFT"). Learn more about our data sources.

start_date

The earliest date for which data is retrieved. Note that if interval is not 0 (daily), the first data point maybe earlier than the start_date provided - it will be the first date of the period requested.

end_date

Optional. The latest date for which data will be retrieved. Default is start_date.

interval

Optional. Specifies the interval each data value represents as follows:

0 = daily,
1 = weekly,
2 = monthly.

Default is 0.

headers

Optional. Specifies whether to display headings as follows:

0 = no headers,
1 = show headers,
2 = show instrument identifier and headers.

Default is 1 (i.e, show headers). When included, headers are rows of textthat are part of the array returned from the function.

property0 - property5

Optional. The columns that are retrieved for each stock as follows:

0 = Date,
1 = Close,
2 = Open,
3 = High,
4 = Low,
5 = Volume.

If any of them is present, only the indicated columns are returned in the order provided. Default is 0,1 (i.e., Date and Close).

Notes

  • The STOCKHISTORY function does not stamp a format on the cells that it spills into. If you delete the formula, the cells that it filled have the General format.

  • When you enter the property arguments, you type a number for each property 0 through 5, in the order you want to see them. The value you enter for each property corresponds to the property number. For example, to include Date, Open, and Close, enter 0,2,1. These properties are defined as follows:

    Value

    Property

    Definition

    Date

    If interval is daily or weekly, the first valid trading day in the period.
    If interval is monthly, the first day of the month, regardless of if it was a trading day.

    1

    Close

    Closing price on the last trading day in the period

    2

    Open

    Opening price on the first trading day in the period

    3

    High

    Highestday’s high in the period

    4

    Low

    Lowestday’s low in the period

    5

    Volume

    Number of shares traded during the period

Tips

  • If you want to get the highest high over a 3-month period, it is faster to use a monthly interval than a daily or weekly interval. For example, =MAX(STOCKHISTORY("XNAS:MSFT", "1/1/2022", "3/1/2022", 2, 0, 3)) will calculate the maximum value of 3 datapoints (one for each month), data only with no headers, for the highest trading value for each month. If instead the formula used a weekly or daily interval, you would get the same result but there would be many more datapoints used in the calculation which can lead to reduced performance.

  • If you want to see a 52-week high or low, it is often faster to use aStocks data type, which has those properties readily available. For example, convert "xnas:msft" to a stock data type in cell A1, and in cell B1 you can write the formula =A1.[52 week high] to get the value. You can also configure your workbook to automatically refresh that value as described here.

  • STOCKHISTORY, in showing historical data, generally only updates after a trading day completes. This means that you cannot use STOCKHISTORY to get data for today's trading details until after the market has closed or after the day has completed depending on the market.

  • If you use STOCKHISTORY with a function that automatically updates (like TODAY) and if your workbook has automatic calculation enabled, then STOCKHISTORY will automatically refresh the data when you open the workbook. This update will happen in the background, and you can edit your workbook as desired while this update is underway. If yourworkbook uses large number of STOCKHISTORY function calls, this background update will continue as long as needed to update the data. You may close yourworkbook at any time during this process if you wish.

Need more help?

Want more options?

Discover Community

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

STOCKHISTORY function - Microsoft Support (1)

Microsoft 365 subscription benefits

STOCKHISTORY function - Microsoft Support (2)

Microsoft 365 training

STOCKHISTORY function - Microsoft Support (3)

Microsoft security

STOCKHISTORY function - Microsoft Support (4)

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

STOCKHISTORY function - Microsoft Support (5)

Ask the Microsoft Community

STOCKHISTORY function - Microsoft Support (6)

Microsoft Tech Community

STOCKHISTORY function - Microsoft Support (2024)

FAQs

How to enable stockhistory function in Excel? ›

  1. The STOCKHISTORY function belongs to the Lookup & Reference family of functions.
  2. Date arguments can be a date enclosed in double quotes (e.g. "01-01-2020") or a formula (e.g. TODAY()) or a cell reference to a cell with a date.
  3. Date returned may be earlier than the date provided.

Why is stock history blocked in Excel? ›

There are a few reasons why you might be getting the #BLOCKED error when using the StockHistory function in Excel on Mac. 1. You are using the free online version of Excel. The StockHistory function is not available in the free online version.

Where can I get free historical stock data? ›

Internet Sources for Historical Market & Stock Data
  • Yahoo! Finance - Historical Prices. ...
  • Dow Jones Industrial Averages. Historical and current performance data. ...
  • S&P Indices. Historical performance data.
  • IPL Newspaper Collection. ...
  • Securities Industry and Financial Markets Association. ...
  • FINRA: Market Data Center.

What is the alternative to the Stockhistory function? ›

If the Stock History function continues to have issues, you may consider alternative solutions such as using a different data provider, manually entering currency exchange rates, or using a third-party add-in or plugin for currency conversion.

Why dont I have the stock option on Excel? ›

Note: The Stocks and Geography data types are only available to Microsoft 365 accounts or those with a free Microsoft Account. You must also have the English, French, German, Italian, Spanish, or Portuguese editing language added to Office Language Preferences.

How to get rid of blocked in Excel? ›

Change external content settings for Excel in the Trust Center
  1. In Excel, click the File tab.
  2. Click Options > Trust Center > Trust Center Settings.
  3. On the left, select External Content.
  4. Click the option that you want under Security settings for Data Connections:

How do I get stock history data in Excel? ›

How to Use the STOCKHISTORY Function
  1. stock – Enter a ticker symbol in double quotes (g., “MSFT”) or a reference to a cell containing the Stocks data type. ...
  2. start_date – The earliest date for which data is retrieved. ...
  3. [end_date] – The latest date for which data will be retrieved.
Jan 28, 2021

How do I remove restrictions in Excel? ›

Remove restrictions

On the Review tab, under Protection, select Permissions, and then select No Restrictions. In the dialog box, select Remove Restrictions.

What is the best free stock analysis software? ›

6 best free stock screeners
  1. Morningstar. Morningstar's basic stock screener offers a clean interface with multiple filter options. ...
  2. Finviz. Finviz is often included in roundups of the best stock screeners, and for good reason. ...
  3. 3. Yahoo Finance. ...
  4. TradingView. ...
  5. StockFetcher.
Apr 29, 2024

How to check stock history? ›

If you're looking for a historical range of data on an individual security then you can use Investopedia's Markets section to find what you need. In order to navigate to the historical data, enter the ticker symbol of the equity you're looking for into the "Search Company or Symbol" search box on the page.

Why do companies have a ticker symbol instead of just using their full name? ›

Stock tickers provide specific information about a company's stock, such as stock price and trading volume, while a ticker symbol is a unique abbreviation that identifies a specific company's shares on stock exchanges.

What is the function of Stockhistory? ›

The STOCKHISTORY function retrieves historical stock price information based on a given symbol and date range. The main purpose of STOCKHISTORY is to get the history of a financial instrument over time.

How to track historical data in Excel? ›

Click the Advanced tab. Under Track changes, click Keep change history for and, in the days box, type the number of days of change history that you want to keep. By default, Excel keeps the change history for 30 days and permanently erases any change history that is older than this number of days.

How to use Excel for stock analysis? ›

Excel has built-in algorithms for calculating a number of financial measures that are essential for stock analysis. Use the calculation ((Closing Price – Opening Price) / Opening Price) * 100 to determine daily or periodic returns. Calculate volatility as well by determining the returns' standard deviation.

How do I enable historians in Excel? ›

Procedure
  1. Open a new Microsoft Excel worksheet.
  2. Select File > Options. The Excel Options window appears.
  3. Select Add-Ins.
  4. In the Manage box, select Excel Add-ins, and then select Go. The Add-Ins window appears.
  5. Select the Proficy Historian Add-In and Proficy_Historian_Helper check boxes, and then select OK.

How do I turn on enable content in Excel? ›

Click the File tab > Info. In the Security Warning area, click Enable Content > Advanced Options. In the Microsoft Office Security Options dialog box, select Enable content for this session, and click OK.

How do I turn on legend in Excel? ›

Select a chart and then select the plus sign to the top right. Point to Legend and select the arrow next to it. Choose where you want the legend to appear in your chart.

Top Articles
Keyboard shortcuts in Windows - Microsoft Support
Get started with Screen Time on iPad
Www.paystubportal.com/7-11 Login
Blorg Body Pillow
Joliet Patch Arrests Today
Unblocked Games Premium Worlds Hardest Game
Collision Masters Fairbanks
Rainbird Wiring Diagram
Seething Storm 5E
How Much Is 10000 Nickels
Videos De Mexicanas Calientes
Melfme
Unraveling The Mystery: Does Breckie Hill Have A Boyfriend?
Cosentyx® 75 mg Injektionslösung in einer Fertigspritze - PatientenInfo-Service
Produzione mondiale di vino
Costco in Hawthorne (14501 Hindry Ave)
Grand Park Baseball Tournaments
Mercy MyPay (Online Pay Stubs) / mercy-mypay-online-pay-stubs.pdf / PDF4PRO
Find your energy supplier
Mission Impossible 7 Showtimes Near Regal Bridgeport Village
Slushy Beer Strain
ocala cars & trucks - by owner - craigslist
7543460065
Cashtapp Atm Near Me
boohoo group plc Stock (BOO) - Quote London S.E.- MarketScreener
Candy Land Santa Ana
Vigoro Mulch Safe For Dogs
Christina Steele And Nathaniel Hadley Novel
Wkow Weather Radar
Marquette Gas Prices
City Of Durham Recycling Schedule
Wat is een hickmann?
SOGo Groupware - Rechenzentrum Universität Osnabrück
Japanese Emoticons Stars
Sam's Club Near Wisconsin Dells
Helloid Worthington Login
Boneyard Barbers
What Is Xfinity and How Is It Different from Comcast?
Microsoftlicentiespecialist.nl - Microcenter - ICT voor het MKB
The 50 Best Albums of 2023
Evil Dead Rise (2023) | Film, Trailer, Kritik
Simnet Jwu
VPN Free - Betternet Unlimited VPN Proxy - Chrome Web Store
VDJdb in 2019: database extension, new analysis infrastructure and a T-cell receptor motif compendium
Pain Out Maxx Kratom
Arcanis Secret Santa
Babykeilani
Take Me To The Closest Ups
View From My Seat Madison Square Garden
March 2023 Wincalendar
Frank 26 Forum
Www.card-Data.com/Comerica Prepaid Balance
Latest Posts
Article information

Author: Carmelo Roob

Last Updated:

Views: 6145

Rating: 4.4 / 5 (65 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Carmelo Roob

Birthday: 1995-01-09

Address: Apt. 915 481 Sipes Cliff, New Gonzalobury, CO 80176

Phone: +6773780339780

Job: Sales Executive

Hobby: Gaming, Jogging, Rugby, Video gaming, Handball, Ice skating, Web surfing

Introduction: My name is Carmelo Roob, I am a modern, handsome, delightful, comfortable, attractive, vast, good person who loves writing and wants to share my knowledge and understanding with you.