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? ›

StockHistory Function in Excel 365
  1. Enter the formula =STOCKHISTORY("MSFT","15/9/2023") in the C3 cell. The headings Date and Close are automatically generated along with the starting date and the stock value when we press the “Enter” key.
  2. Let's go with other parameters.
Dec 22, 2023

Why is stockhistory not working in Excel? ›

The fix or issue has to do with server and authentication of online connected services. The user of excel has to authorize connected services as that is a security risk whenever an outside computer can import or have access to local computer services or apps.

What is the alternative to the Stockhistory function? ›

An Alternative of Stockhistory Function on Excel

An alternative to the Stockhistory function on Excel is the Google Finance function. It works in a very similar way to the Stockhistory function on Excel except it is more straightforward to use.

What outputs does the stockhistory function show? ›

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.

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 stock historical data 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 my data analysis not working on Excel? ›

Ensure You Have Data Selected: The "Analyze Data" feature is often dependent on having a range of data selected. Make sure you have a cell within a table or range of data selected, and then try to click on the "Analyze Data" button.

How do I enable analyze in Excel? ›

Open Excel and open a blank worksheet. Click on the Data tab of the worksheet (not the pulldown menus at the top of the screen). On the ribbon (Click View and check Ribbon if it is not visible), click on Data Analysis Toolpak option to enable it. Click OK.

How do I enable stock in Excel? ›

To create a table, go to Insert > Table. With the cells still selected, go to the Data tab, and then click Stocks. Select one or more cells with the data type, and the Add Column button will appear. Click that button, and then click a field name to extract more information.

How do I enable stock chart in Excel? ›

Follow the below steps to create your first Stock Chart. Select the data in the worksheet. Go to INSERT> Stock Chart > Open-High-Low-Close.

How do you automatically update stock prices in Excel? ›

Here's how: Right-click a data type in your workbook, and then select “Data Type” > “Refresh Settings”. In the “Data Types Refresh Settings” pane, select the option you want. You can choose to refresh when you open the file, manually, or automatically every five minutes.

What is the interval of Stockhistory in Excel? ›

When using the STOCKHISTORY function in Excel, you can specify the interval for the data you want to retrieve. The interval argument can be set to 0 for daily data, 1 for weekly data, or 2 for monthly data. If you set the interval argument to 0, the function will return daily data for the specified date range.

How do I access historical stock data? ›

Online brokerage sites such as eTrade and TD Ameritrade or apps like Robinhood will have both real-time and historical quote data for customers and usually limited access for non-customers as well. Financial websites like Motley Fool or Google Finance will also provide quote information for both stocks and indices.

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.

Top Articles
MicroStrategy (MSTR) - basic shares outstanding
FD Vs RD – Know Which is the better option
Hotels Near 6491 Peachtree Industrial Blvd
Fiskars X27 Kloofbijl - 92 cm | bol
Ffxiv Act Plugin
Craigslist Free En Dallas Tx
Brady Hughes Justified
Inducement Small Bribe
Canary im Test: Ein All-in-One Überwachungssystem? - HouseControllers
Steamy Afternoon With Handsome Fernando
P2P4U Net Soccer
Aiken County government, school officials promote penny tax in North Augusta
Nordstrom Rack Glendale Photos
Palace Pizza Joplin
270 West Michigan residents receive expert driver’s license restoration advice at last major Road to Restoration Clinic of the year
2021 Lexus IS for sale - Richardson, TX - craigslist
The Weather Channel Facebook
Socket Exception Dunkin
OSRS Dryness Calculator - GEGCalculators
Best Suv In 2010
Bitlife Tyrone's
Po Box 35691 Canton Oh
/Www.usps.com/International/Passports.htm
Busted News Bowie County
The Many Faces of the Craigslist Killer
Craigslist Apartments In Philly
Nk 1399
Claio Rotisserie Menu
Carroway Funeral Home Obituaries Lufkin
Login.castlebranch.com
Bridgestone Tire Dealer Near Me
Ezstub Cross Country
Broken Gphone X Tarkov
Wisconsin Volleyball Team Leaked Uncovered
Melissa N. Comics
Flaky Fish Meat Rdr2
7543460065
Chatropolis Call Me
„Wir sind gut positioniert“
Infinite Campus Farmingdale
11526 Lake Ave Cleveland Oh 44102
O'reilly's Palmyra Missouri
814-747-6702
Canvas Elms Umd
Meet Robert Oppenheimer, the destroyer of worlds
UNC Charlotte Admission Requirements
Craigslist Cars For Sale By Owner Memphis Tn
Otter Bustr
Tweedehands camper te koop - camper occasion kopen
Who We Are at Curt Landry Ministries
The Love Life Of Kelsey Asbille: A Comprehensive Guide To Her Relationships
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 6231

Rating: 4 / 5 (41 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.