Introduction
Excel is a powerful tool for organizing and analyzing data, but manually searchingthrough the history of financial data from different resources can be time-consuming. Inthis article, we will gain deep insights into the StockHistory function that is availableonly in Microsoft 365 and returns the array describing the stock history of financial dataalong with the specific dates that users specified in a range. The benefits of theStockHistory function include time savings, flexibility, comparative analysis, and so on.
Syntax of StockHistory Function
STOCKHISTORY(stock, start_date [,end_date] [,interval] [,headers] [,properties][..])
Stock − Specify the cell range or ticker symbol of the corporation in delimiter that is in double quotes which is valid Excel 365. For example, AAL, MSFT.
Start_date − It indicates the starting date when the stock data is extracted.
End_date − It specifies the ending date that stock data is fetched and is an optional argument.
Interval − It is also an optional argument and by default value is 0 representing the Daily stock value whereas 1 denotes the weekly stock value and 2 specifies the monthly stock value.
Headers − It is also an optional argument. It permits users whether to showcase headings or not. It comprises three values 0(heading is not illustrated), 1(include headings), and 2(display headers along identifiers).
Properties − It is also an optional argument and specifies the Excel columns that are taken out for every stock. It is comprised of 6 numbers that are 0,1,2,3,4,5 and 6 and by default, numbers are 0(Date) and 1(Close). The other numbers of specifications are given in brackets like 2(Open),3(High), 4(Low), and (5) Volume.
StockHistory Function in Excel 365
Step 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.
Step 2
Let’s go with other parameters. Users need to edit the formula =STOCKHISTORY("MSFT","15/9/2023","30/9/2023",1,1) in the same cell as shownbelow −
Explanation
=STOCKHISTORY("MSFT","15/9/2023","30/9/2023",1,1)
The first argument represents the ticker symbol of the Microsoft company.
The second argument specifies the starting date from which stock data is to befetched.
The third argument indicates that the ending date stock data is to be extracted tillthis date.
The fourth argument specifies the weekly stock data to be displayed between thespecified dates.
The fifth argument denotes the stock data to be fetched along with headers.
Step 3
Press the “Enter” key to obtain the weekly stock data between the prescribed dates along with headers.
Conclusion
This article will guide you through the procedure of using Excel 365's StockHistoryfunction. Users must carefully type the function syntax along with the appropriate parameters to obtain an accurate result.
Updated on: 22-Dec-2023
912 Views
- Related Articles
- ARRAYTOTEXT function in Excel 365
- Expand function in Excel 365
- MAP function in Excel 365
- RANDARRAY function in Excel 365
- REDUCE function in Excel 365
- TAKE function in Excel 365
- Unique function in Excel 365
- Isomitted function in Excel 365
- How to use DROP function in Excel 365?
- How to perform LAMBDA Function in Excel 365?
- How to use Let function in Excel 365?
- How to quickly use VALUETOTEXT function in Excel 365?
- How to create and test the User Defined Function to compute the Area of a Triangle in Excel 365?
- How to generate QR codes with Excel in Microsoft 365 or Google Sheets?
- XMATCH function in Excel
Advertisem*nts
';