The GOOGLEFINANCE function is part of Google Sheets. Google Sheets is available in both consumer Gmail and organization-wide G Suite. The function allows users to create trend charts and comparisons for any assets that have a valid Google Finance ticker symbol.
Here are several examples of how the GOOGLEFINANCE function can be used in Google Sheets to compare the performance of stocks and indexes against one another.
GOOGLEFINANCE Function Examples
Facebook Stock Price vs Apple Stock Price
Apple and Facebook are two well-known Silicon Valley technology companies. By creating a chart from two GOOGLEFINANCE functions, the relative performance can be easily seen. Here is a link to the Google Sheet. You can save it as a new Google Sheet, or save it as a Microsoft Excel file.
Bitcoin vs Gold
To view the Bitcoin price in Google Sheets is as simple as pasting a formula like this into a cell:
=GOOGLEFINANCE(“BTCUSD”, “price”, DATE(2017,1,1), DATE(2018,12,31), “DAILY”)
The GOOGLEFINANCE function does not support commodities. Because of this, we used an INDEX function to import the current price of gold from a service called Packetizer. That formula is:
The resulting combination is the following chart. The chart shows the daily Bitcoin price compared to the current gold price. You can display daily Bitcoin prices by hovering your cursor.
The chart takes 15 to 30 seconds to load from Google Docs. You can view the full chart here.
It’s easy to chart a stock market index using the GOOGLEFINANCE function. More columns can be added to the spreadsheet to track performance against a target.
This chart shows the 2018 trend of the DJIA compared to the high water mark for the year. The chart includes a “bear line”, which is 20% below the year’s maximum. Here is a link to the Google Sheet.
GOOGLEFINANCE Stock Attributes
With the use of simple formulas, the values of various stock attributes can be displayed in a Google Sheet. For the example below, we chose CRM, the ticker for salesforce.com. Here is a link to the Google Sheet. You can save it as a new Google Sheet, or download it in a variety of formats, including .XLSX.
GOOGLEFINANCE Fund Attributes
Fund attributes can be displayed in a Google Sheet in a similar manner. This information is for the Fidelity® Contrafund® Fund.