How to Use Google Sheets’ GOOGLEFINANCE Function (Versus Excel’s Stock Data Functions)

How to Use Google Sheets' GOOGLEFINANCE Function (Versus Excel's Stock Data Functions)

Google Sheets’ GOOGLEFINANCE function and Excel’s stock data functions extract real-time financial data from stock markets. Both functions serve similar purposes providing access to real-time financial data, but the difference lies in the usage and scope. In this article, we will show you the use of GOOGLEFINANCE in Google Sheets and Excel’s stock data functions while comparing them.

What is GOOGLEFINANCE in Google Sheets?

Google Sheets’ GOOGLEFINANCE function imports real-time financial data from Google Finance. It can import stock prices, exchange rates, or financial metrics based on parameters.

Syntax:

=GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval])

  • ticker: It’s the ticker symbol of the stock or financial asset (e.g., “GOOG” for Google).
  • [attribute]–[Optional]: The financial data you want to retrieve about trickers like “price”, “volume”, or “marketcap”.
  • [start_date]-[Optional]: The start date for importing historical data.
  • [end_date|num_days]-[Optional]: The end date when importing historical data, or the number of days from ‘start_date’ for which to return data.
  • [interval]-[optional]: The frequency of returned data (either “DAILY” or “WEEKLY”).

What are Excel’s Stock Data Functions?

Excel’s Stock Data Functions allow users to access and work with real-time stock market data easily.  Excel provides Stock data type and STOCKHISTORY function, introduced in Excel 365. These functions can pull data related to stocks, bonds, and other financial instruments directly into Excel using Microsoft’s data services.

Stock Data Types:

Excel has built-in stock data types that allow users to reference real-time data for stocks by converting the ticker symbol into stock data. It will import the data into the adjacent cells.

Steps:

  1. First type the company’s name or ticker symbol in a cell (e.g., “GOOG” for Google, “MSFT” for Microsoft).
  2. Go to the Data tab >> select Stocks from the Data Types group.
  3. Excel will convert the ticker symbol into a Stock data type.
  4. Now, you can extract specific fields (e.g., price, market cap, etc.) using the Insert Data button next to the cell.

STOCKHISTORY Function:

The STOCKHISTORY function retrieves historical stock data, such as the closing price, from a selected date range.

Syntax:

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

  • stock: The stock ticker symbol.
  • start_date: The start date to import stock data.
  • [end_date]-[Optional]: The end date to import data. If omitted, only the start date’s data is returned.
  • [interval]-[Optional]: The data frequency to return data (e.g., 0 for Daily, 1 for Weekly).
  • [headers]-[Optional]: To show headers (e.g., 0 for No header, 1 for Show header, 2 for Show instrument identifier and headers).
  • [properties]-[Optional]: Imports specific stock information columns like closing price, open price, high, low, etc.
    • 0 = Date,
    • 1 = Close,
    • 2 = Open,
    • 3 = High,
    • 4 = Low,
    • 5 = Volume.

Using Google Sheets’ GOOGLEFINANCE Function and Excel’s Stock Data Functions

Suppose you want to import the weekly stock price of Apple for the first quarter. You can import the stock data by using Both Google Sheets and Excel’s functions. Let us show you the steps to do so.

Google Sheets’ GOOGLEFINANCE Function

To import the weekly stock price of Apple, you can use the GOOGLEFINANCE function. Select cell A1 and insert the following formula.

Formula:

=GOOGLEFINANCE(“AAPL”, “price”, “01/01/2024”, “30/04/2024”, “WEEKLY”)

Explanation: This formula will return the weekly stock price of Apple from 1st January 2024 to 30th April 2024 in Google Sheets.

  • “AAPL”: It’s the ticker symbol of Apple.
  •  “price”: Here, the attribute is the price as you want to be important.
  • “01/01/2024”: Start date to import historical data.
  •  “30/04/2024”: End date for importing stock price.
  •  “WEEKLY”: It will return the weekly stock price of the date range.

Output:

Date Close
05/01/2024 16:00:00 181.18
12/01/2024 16:00:00 185.92
19/01/2024 16:00:00 191.56
26/01/2024 16:00:00 192.42
02/02/2024 16:00:00 185.85
09/02/2024 16:00:00 188.85
16/02/2024 16:00:00 182.31
23/02/2024 16:00:00 182.52
01/03/2024 16:00:00 179.66
08/03/2024 16:00:00 170.73
15/03/2024 16:00:00 172.62
22/03/2024 16:00:00 172.28
28/03/2024 16:00:00 171.48
05/04/2024 16:00:00 169.58
12/04/2024 16:00:00 176.55
19/04/2024 16:00:00 165
26/04/2024 16:00:00 169.3

Excel’s Stock Data Functions

You can do a similar task by using the STOCKHISTORY function in Excel. Select cell A1 and insert the following formula.

Formula:

=STOCKHISTORY(“AAPL”,”01/01/2024″, “04/30/2024”, 1,1)

Explanation: This formula will return the weekly stock price of Apple from 1st January 2024 to 30th April 2024 in Excel.

  • “AAPL”: It’s the ticker symbol of Apple.
  • “01/01/2024”: Start date to import historical data.
  • “04/30/2024”: End date for importing stock price.
  • 1: As the interval is 1 it will return the weekly stock price of the date range.
  • 1: To show the header of the properties.

Output:

Date Close
1/2/2024  $  181.18
1/8/2024  $  185.92
1/16/2024  $  191.56
1/22/2024  $  192.42
1/29/2024  $  185.85
2/5/2024  $  188.85
2/12/2024  $  182.31
2/20/2024  $  182.52
2/26/2024  $  179.66
3/4/2024  $  170.73
3/11/2024  $  172.62
3/18/2024  $  172.28
3/25/2024  $  171.48
4/1/2024  $  169.58
4/8/2024  $  176.55
4/15/2024  $  165.00
4/22/2024  $  169.30
4/29/2024  $  183.38

You also can use the stock data types to retrieve similar stock data.

Conclusion

Both Google Sheets and Excel’s stock data functions impost real-time stock data. Both functions are simple to use to fetch financial data. The GOOGLFINANACE function is good for tracking basic financial data of individual companies or for small portfolios. It doesn’t provide detailed information on global stock exchanges or niche financial data. But Excel’s stock data functions give access to a wide range of global stock exchanges and detailed stock data with better accuracy for financial analysis. It is useful for professionals tracking multiple asset classes. But only available in 365. Based on your analysis and your needs you can choose the platforms of your choice.

Leave a Reply

Your email address will not be published. Required fields are marked *