STOCKHISTORY function in Excel 365


Introduction

Excel is a powerful tool for organizing and analyzing data, but manually searching through the history of financial data from different resources can be time-consuming. In this article, we will gain deep insights into the StockHistory function that is available only in Microsoft 365 and returns the array describing the stock history of financial data along with the specific dates that users specified in a range. The benefits of the StockHistory 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 shown below −

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 be fetched.

  • The third argument indicates that the ending date stock data is to be extracted till this date.

  • The fourth argument specifies the weekly stock data to be displayed between the specified 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 StockHistory function. Users must carefully type the function syntax along with the appropriate parameters to obtain an accurate result.

Updated on: 22-Dec-2023

101 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements