One of the lesser-known functions in Google Sheets is GOOGLEFINANCE, which allows you to track current or historical financial securities data on the stock market. Here’s how to use it.
What is Google Finance?
Finance is Google’s real-time tool that displays current market information and aggregates business news. It’s currently integrated with Google Search, so if you look up the ticker symbol of a specific corporation on Google such as WMT for Walmart or AAPL for Apple, you will immediately see the current stock quote and historical data for that security. You can click one of these stocks to go to a company’s Google Finance page, which shows the company’s financials, related news, and allows you to compare it with other commodities.
While there are other, more robust tools you can use to track securities, Google Finance is the only one that can effectively integrate with Google Sheets. Whether you’re a novice to stocks or an experienced trader, this integration is the easiest way to import and monitor stock data in a spreadsheet.
By the way, Google Finance’s sheets integration is only available in English and doesn’t include most international exchanges yet. So if you want to transact on Asian or European exchanges, this may not be the best option for you.
The Google Finance Function
The function that pulls stock data is called “GOOGLEFINANCE.” The syntax of the function is quite simple and uses five arguments, four of which are optional.
The first argument is the ticker symbol. These are codes that companies have when they’re listed on the stock market, such as GOOG for Google or BAC for Bank of America. You can also specify the stock exchange that your chosen stock is listed in to avoid discrepancies. Since Bank of America is listed on the New York Stock Exchange, you’d type “NYSE:BAC.”
To get the ticker codes and exchanges of you’re desired stocks, you’ll have to do some research. You can look for them on Google Finance or your chosen portfolio management tool.
The second argument is the attribute you’d like to display. By default, it’s set to “price” if you leave it blank. Here are a few of the attributes you can pull out using the function:
- price: The price of the specific stock in real-time.
- volume: The current trading volume.
- high: The current or chosen day’s high price.
- low: The current or chosen day’s low price.
- volumeavg: The average trading daily trading volume.
- pe: The price to earnings ratio.
- eps: The earnings per share.
Take note that the attributes you can display vary on whether you’re using current or historical data. Here’s a full list of attributes that you can use for the argument. It’s important to remember that current data refreshes every 15 minutes, so it’s not completely real-time.
The third argument is the start date, which only applies if you’re using historical data. You can type “TODAY()” or leave it blank to display real-time data. The fourth argument specifies either the end date or the number of days from the start date. If left blank, the function will return the data from a single day.
The last argument is the interval, which allows you to specify the frequency of the data. You can set it to “DAILY” or “WEEKLY.”
One thing to note is that Google Sheets processes the ticker symbol and attribute arguments as text, so make sure to place quotation marks around them, or you will get an error.
Stock Tracking in Action
For this example, let’s say you want to look up the current price of a stock of Facebook. Facebook is listed on NASDAQ with the ticker code FB. In this case, you’ll type down the first argument as “NASDAQ:FB” along with “price” as the attribute. So the formula for this would be
If you want to view the daily closing prices for a particular week, such as the week of October 15, 2018, you will specify that date range in the third and fourth arguments. The code for that becomes
=GOOGLEFINANCE("NASDAQ:FB","price",DATE(2018,10,15),DATE(2018,10,20)) . Take note that viewing historical data expands the generated information into array data, which takes up nearby cells.
You can also use the function to generate data for a list of stocks automatically. Just type out the tickers in a column, then use the cells in your first argument. Since our ticker code is in cell C4, you’d type out
=GOOGLEFINANCE(C4,"price"). Below is a list of stocks with their corresponding current prices.
If you want to track a list of attributes, you can type them out in separate cells like in the above image. Then, you can link the second argument to the cell with the attribute’s name. For the price cell for NYSE:IBM in the example below, the formula would be
Maximizing Google Sheets
The best part of having your stocks on Google Sheets is that you can use various data manipulation tools on them.
For example, let’s say you want to use Google Sheets to keep track of the value of all of your financial assets, such as your stocks, savings accounts, time deposits, and more. Using Finance, the price of your stocks will update in real-time, so you get a full picture of your position at any given time.
Converting Currency with Sheets
Another great function of Google Sheets is that it can convert currencies in real-time. You can do this by typing the stock ticker “CURRENCY:” followed by the codes of the two currencies you want to convert, such as “USDGBP” or “EURJPY.” You can also display historical currency data by specifying a date.
For example, if you’re living in Europe and you want to convert some USD into the Euro, you’d type
=GOOGLEFINANCE("CURRENCY:USDEUR") and multiply that number with the amount of USD you’re converting.
This has a lot of great use-cases besides foreign exchange trading. For example, if your line of work involves getting paid in a different currency, you can set up an invoice that automatically converts the payments you receive to your home currency.