GOOGLEFINANCE eLearning Module

Guide to Using the GOOGLEFINANCE Function in Google Sheets

The GOOGLEFINANCE function allows you to import real-time financial and currency market data directly into Google Sheets. This function also enables tracking of both current and historical data for various financial instruments such as stocks and shares.

This data is imported from the Google Finance web application, which provides daily stock prices, financial market news, and analysis of market trends. You can access Google Finance from the Google menu or by searching for a stock on Google, where the first result will display information from Google Finance.

Previously, analysts had to visit multiple financial websites or databases to gather stock information, which was then manually compiled into spreadsheets for further analysis. This process was cumbersome and unreliable. Another approach involved using custom scripts to scrape data, which was faster but required coding expertise and lacked flexibility.

The GOOGLEFINANCE function offers a more reliable and economical solution. If you work with financial market data, this function can automate data retrieval and save you considerable time.

Welcome to the GOOGLEFINANCE eLearning Module. This module will help you understand and use the GOOGLEFINANCE function in Google Sheets.

The basic syntax for the GOOGLEFINANCE function is:

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

Parameters:

  • ticker - The ticker symbol for the security.
  • attribute - [Optional] The attribute to fetch about the ticker.
  • start_date - [Optional] The start date for fetching historical data.
  • end_date|num_days - [Optional] The end date or number of days for fetching historical data.
  • interval - [Optional] The frequency of returned data ("DAILY" or "WEEKLY").

The attribute parameter can be one of the following:

  • price - Real-time price quote.
  • priceopen - The price as of market open.
  • high - The current day's high price.
  • low - The current day's low price.
  • volume - The current day's trading volume.
  • marketcap - The market capitalization of the stock.
  • tradetime - The time of the last trade.
  • datadelay - How far delayed the real-time data is.
  • volumeavg - The average daily trading volume.
  • pe - The price/earnings ratio.
  • eps - The earnings per share.
  • high52 - The 52-week high price.
  • low52 - The 52-week low price.
  • change - The price change since the previous trading day's close.
  • beta - The beta value.
  • changepct - The percentage change in price since the previous trading day's close.
  • closeyest - The previous day's closing price.
  • shares - The number of outstanding shares.

Here are some examples of using the GOOGLEFINANCE function:

GOOGLEFINANCE("NASDAQ:GOOG", "price", DATE(2014,1,1), DATE(2014,12,31), "DAILY")
GOOGLEFINANCE("NASDAQ:GOOG","price",TODAY()-30,TODAY())
GOOGLEFINANCE(A2,A3)
                            

Test your knowledge by completing the following exercises:

  • Use the GOOGLEFINANCE function to fetch the current price of Apple Inc. (AAPL).
  • Fetch the historical data for Microsoft Corporation (MSFT) from January 1, 2021, to December 31, 2021.
  • Find the 52-week high and low prices for Tesla, Inc. (TSLA).