ShareYourGroupShareYourGroupGoogle Sheets

Web and import

GOOGLEFINANCE function in Google Sheets

GOOGLEFINANCE fetches current or past prices of shares and currencies from Google Finance.

GOOGLEFINANCE brings market data into a sheet: share prices, index levels, currency rates. With it, a list of holdings can show its own current value. Nothing has to be typed in or downloaded.

The examples have no results printed here, because the answers change through the day. The information on this page is about how the function works. It is not investment advice.

Syntax

=GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval])
ArgumentWhat it is
tickerThe exchange and symbol as text, such as "NSE:INFY", or a currency pair such as "CURRENCY:USDINR".
attributeWhat to fetch: "price" (the default), "high", "low", "volume", "marketcap", "pe", "close" and others.
start_dateFor past data: the first date.
end_date or num_daysThe last date, or a number of days from the start date.
interval"DAILY" or "WEEKLY".

Examples

Before relying on it

Google states that the data may be delayed, by up to about twenty minutes for some exchanges, and that it is provided "as is" for information, not for trading. Treat the figures as a convenient guide. For a transaction, a tax return or accounts, use the figures from your broker, the exchange or your bank.

Not every exchange and instrument is covered, and coverage changes. If a symbol returns #N/A, check on the Google Finance website whether it is listed there and under what code.

The ticker

Write the exchange code, a colon and the symbol, in quotation marks: "NSE:INFY", "BOM:500209", "NASDAQ:GOOG". Without the exchange, Google guesses, and may pick a company of the same symbol in another country. Always include it.

Keep the tickers in a column and refer to the cell: =GOOGLEFINANCE(A2). Then one formula, copied down, prices a whole list.

Attributes

AttributeGives
"price"latest price (the default)
"priceopen"today's opening price
"high", "low"today's high and low
"volume"shares traded today
"marketcap"market capitalisation
"pe"price-to-earnings ratio
"eps"earnings per share
"high52", "low52"52-week high and low
"change", "changepct"change since the previous close
"closeyest"previous day's close

Some attributes are not available for every instrument.

Currencies

A currency pair is written "CURRENCY:" followed by the two three-letter codes, from and to: "CURRENCY:USDINR" is the price of one dollar in rupees. Multiply an amount by it to convert. The rate is a market mid-rate. A bank or card will apply its own rate and charges.

Past prices

Give a start date, and either an end date or a number of days, and the function returns a table: a heading row, then a row for each day with the date and the value. Dates in the result carry a time of day.

Because a historical request returns a table even for a single day, picking one figure needs INDEX, as in the last example: row 2, column 2 is the first value under the headings.

Past data makes a good partner for SPARKLINE: =SPARKLINE(GOOGLEFINANCE("NSE:INFY","close",TODAY()-90,TODAY())) draws three months of prices in one cell.

A simple holdings table

With tickers in column A, quantities in B and purchase prices in C:

Limits

Common mistakes

In Excel

Excel has no GOOGLEFINANCE. Microsoft 365 offers a Stocks data type and a STOCKHISTORY function. A sheet with GOOGLEFINANCE keeps only its last values when saved as an Excel file.

Related functions

The results on this page were worked out by us from the sample sheet; they were not produced by a script running Google Sheets. If Sheets shows you something different, please tell us.

This is an independent help site. It is not connected with or approved by Google. Google Sheets is a trademark of Google LLC, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.