Google Sheets has a built-in function called GOOGLEFINANCE which fetches current or historical securities information from Google Finance to a Google Sheet. This article details how this function can be used with our Spreadsheets integration to display market data on your Geckoboard dashboard.
Syntax of the GoogleFinance Function
Here's the syntax of the GOOGLEFINANCE function:
=GOOGLEFINANCE(ticker, [attribute], [start_date], [num_days|end_date], [interval])
- The ticker symbol for the security to consider.
- (Optional -
"price"by default ) - The attribute to fetch about
tickerfrom Google Finance.
- (Optional) - The start date when fetching historical data.
- (Optional) - The end date when fetching historical data, or the number of days from
start_datefor which to return data.
- (Optional)- The frequency of returned data; either "DAILY" or "WEEKLY".
GoogleFinance function in action
Example: How to display Google's stock price on a dashboard
In this example, we'll use the GOOGLEFINANCE function and a Google Sheet Number Widget to display Google's current stock price on a dashboard.
- To fetch Google's current stock price into Google Sheets, open a new Google Sheet and type the following formula into cell
Essentially, what this formula is doing is querying Google Finance for GOOG current price (GOOG is the ticker symbol for Google Inc.). Something similar happens when you Google "Google stock price".
- Save your Google Sheet and give it a name.
- With Google's stock price information in a Google Sheet, switch to your Geckoboard dashboard.
- Click Add widget.
- Choose the Spreadsheets integration.
- Select the Google Sheets file that you just saved.
- Select the Number widget.
- Select the appropriate Sheet (Sheet1 in this example).
- Enter the value of GOOG price in the Number selection (in the above example, it's
- Disable the Comparison Visualization and adjust the title.
- Click to add your widget to your dashboard.
- And that's it! Your Geckoboard dashboard is now displaying the information found in Cell
A2of the Google Sheet – Google's current stock price.
If you're interested in finance and economic data, you might find Quandl very useful. This website has a wide range of public (and private) data from a variety of sources available as hosted CSV files i.e. https://www.quandl.com/api/v3/datasets/WIKI/GOOGL.csv which can be used in combination with our CSV integration.