If you are unable to access your trading platform, possibly due to office network settings or any other reason, you can track real-time stock information in Google Sheets.
You can create your stock portfolio in Google Sheets with the help of the GoogleFinance function. Let’s see how to get real-time BSE and NSE stock prices in Google Sheets throughout the trading session.
By following this tutorial, you can learn to fetch real-time security information from almost any stock market in the world.
For stock exchange codes, delay times (if any) of available stock quotes from different markets, and associated disclaimers, please see the official Google Finance Disclaimer page.
If you are a trader or have used any trading platform in the past, you may find the GoogleFinance function very easy to use because its arguments might be familiar to you.
I’ve set up a sample spreadsheet for you to learn how to use the GoogleFinance function to bring live as well as historical security information into your spreadsheet. Here you go!
Getting Real-Time BSE and NSE Stock Prices in Google Sheets
Syntax of the GoogleFinance Function:
GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval])
In this syntax, we need to specify the ticker
and attribute
. All other arguments are related to historical data.
Let’s begin with a few examples of using GoogleFinance to fetch real-time stock data in Google Sheets.
As you may know, the ticker symbol is essential for tracking related security information. So, how do you find ticker symbols to use in the GoogleFinance formula?
You can find the ticker symbol for the security you want to consider by visiting https://www.google.com/finance/. Simply type the first few letters of the security in the search field to find the stock ticker.
In the example below, you can see that “HDFC Bank Limited” is listed in four stock markets. The ticker symbols/security codes are shown on the left.
Note: Google Finance’s interface is subject to change, so the screenshot may not reflect the latest design.
Examples of NSE and BSE Real-Time Stock Prices
Below are a few formulas demonstrating the use of the GoogleFinance function.
NSE Real-Time Stock Price in Google Sheets:
=GOOGLEFINANCE("NSE:HDFCBANK","PRICE")
BSE Real-Time Stock Price in Google Sheets:
=GOOGLEFINANCE("BOM:500180","PRICE")
Enter these formulas in empty cells, for example, cells A1 and B1, respectively, and wait for the results to load.
In the above GoogleFinance formulas, I used the “price” attribute to get the BSE and NSE real-time stock prices in Google Sheets.
These two formulas fetch the real-time stock prices of “HDFC Bank Limited” from the NSE (National Stock Exchange) and the BSE (Bombay Stock Exchange), respectively.
There are more attributes that you can use to fetch real-time stock data, such as ‘tradetime,’ ‘currency,’ ‘high,’ ‘low,’ ‘volume,’ etc.
We will see the examples below.
Available Arguments in GoogleFinance to Fetch Real-Time Stock Data in Google Sheets
In the following examples, I used the ticker in cell B4 as a reference.
Additionally, I applied the IFERROR function to the formulas because real-time security information for certain attributes, such as ‘datadelay,’ ‘volumeavg,’ and ‘change,’ might not have been available at all times.
The IFERROR will return an empty value instead of an error.
Below are all the available attributes you can use to find BSE and NSE real-time stock prices in Google Sheets:
- ‘price’: To find the real-time market price of the stock.
=IFERROR(GOOGLEFINANCE($B$4,"PRICE"))
- ‘priceopen’: To find the current day’s opening stock price.
=IFERROR(GOOGLEFINANCE($B$4,"PRICEOPEN"))
- ‘high’: To fetch the current day’s highest price of the stock.
=IFERROR(GOOGLEFINANCE($B$4,"HIGH"))
- ‘low’: To fetch the current day’s lowest price of the stock.
=IFERROR(GOOGLEFINANCE($B$4,"LOW"))
- ‘volume’: To find the number of shares traded of the selected stock for the current day.
=IFERROR(GOOGLEFINANCE($B$4,"VOLUME"))
- ‘marketcap’: To find the market cap of the selected stock.
=IFERROR(GOOGLEFINANCE($B$4,"MARKETCAP"))
- ‘tradetime’: To find the time the stock was last traded.
=IFERROR(GOOGLEFINANCE($B$4,"TRADETIME"))
- ‘datadelay’: To get the information on how far delayed the real-time data is.
=IFERROR(GOOGLEFINANCE($B$4,"DATADELAY"))
- ‘volumeavg’: To find the daily trading average volume for this stock.
=IFERROR(GOOGLEFINANCE($B$4,"VOLUMEAVG"))
- ‘pe’: To find the price-to-earnings ratio for the selected stock.
=IFERROR(GOOGLEFINANCE($B$4,"PE"))
- ‘eps’: To find the earnings per share.
=IFERROR(GOOGLEFINANCE($B$4,"EPS"))
- ‘high52’: The 52-week high price of the stock.
=IFERROR(GOOGLEFINANCE($B$4,"HIGH52"))
- ‘low52’: The 52-week low price of the stock.
=IFERROR(GOOGLEFINANCE($B$4,"LOW52"))
- ‘change’: Use this argument to find the change in the price of the selected stock since the close of yesterday’s market.
=IFERROR(GOOGLEFINANCE($B$4,"CHANGE"))
- ‘beta’: Use to find the beta value of the stock.
=IFERROR(GOOGLEFINANCE($B$4,"BETA"))
- ‘changepct’: Use to find the percentage change in the price of the selected stock since the close of yesterday’s market.
=IFERROR(GOOGLEFINANCE($B$4,"CHANGEPCT"))
- ‘closeyest’: To find the closing price of the previous day.
=IFERROR(GOOGLEFINANCE($B$4,"CLOSEYEST"))
- ‘shares’: To track the number of outstanding shares of this stock.
=IFERROR(GOOGLEFINANCE($B$4,"SHARES"))
- ‘currency’: The currency in which the stock is being traded.
=IFERROR(GOOGLEFINANCE($B$4,"CURRENCY"))
Conclusion
By utilizing the above formulas, you can easily obtain BSE and NSE Real-Time Stock Prices in Google Sheets. But don’t stop there!
You can leverage the GoogleFinance function to monitor all your investments in any stock market worldwide, ensuring live price updates.
You can refer to my function guide to access the GoogleFinance guide.
Below are some related resources:
Hi Prashanth,
=GOOGLEFINANCE("BOM:539686","PRICE")
for KP Energy is not returning the values. What could be the reason?Thanks in advance!
I couldn’t get it to work either. I also couldn’t find this ticker on the Google Finance website.
Hello Prashanth,
I’m having trouble using the beta function. Could you please double-check it from your end?
Thanks
It works on my end. Here’s an example:
=GOOGLEFINANCE("AAPL", "beta")
Please check it on any Indian stocks like NSE:RELIANCE, NSE:INFY.
Hi Prashanth,
Firstly superb work.
Just wanted to know that is there any way I can add a filter in this which shows that the share is within the 5, 10, 20 % range of its 52 week high.
And also, is it possible that I can know the Upper limit and lower limit band in terms of percentage i.e., 5, 10, 15, 20.
Thanks
Hi, Rk,
To find the percentage off the 52-Week High (ticker “BOM:500180”), you can try this formula.
=to_percent(1-(IFERROR(GOOGLEFINANCE("BOM:500180","PRICE"))/
IFERROR(GOOGLEFINANCE("BOM:500180","HIGH52"))))
Thanks, Prashant, and in case if we want to track the upper limit band and lower limit regularly, is there any way we can?
Hi,
Good day to you.
How can I get the commodities prices in google sheet?
Thanks
Hi, SPH,
As far as I know, right now, there is no built-in function that supports it. You may require an apps script or add-on.
Hi Prashanth, Is there a way to get the FNO details of NIFTY Stocks? Thanks
Hi, Praveen,
As far as I know, there is no such option present.
Do we have any syntax which can track the delivery percentage of the stock for that particular trading day?
Hello Prasanth,
I get the #N/A error when I call for PE, and Market Cap, for Adani power, FSL & Jetairways. Does it mean anything?
I tried the Iferror method too, could you please clarify?
Thanks in advance.
Hi, Natarajan,
In my test, the following returns the value (market capitalization of the stock).
Formula # 1:
=GOOGLEFINANCE("AdaniPower","marketcap")
Formula # 2:
=GOOGLEFINANCE("BOM:533096","marketcap")
But for “PE” (the price/earnings ratio), it returns #N/A.
We can use IFERROR or IFNA to remove the #N/A as below.
=ifna(GOOGLEFINANCE("AdaniPower","pe"))
Other than this, there is no other purpose of using these functions with GOOGLEFINANCE.
Regarding the errors, it may often happen with the GOOGLEFINANCE function. It might work the next time.
The symbol is NIFTY_50 but it has stopped working in my sheet for the last two days. In fact, everywhere it has stopped working. What can be the issue?
Thanks
Hi, SPH,
It’s widely reported. Let’s hope it will be rectified soon.
Hello there,
Can anyone please guide how do we get the Nifty50 and NiftyBank price syntax for the Google finance sheet? It was working earlier with the syntax
=GOOGLEFINANCE("NSE:" &A1,"PRICE")
but now it has stopped working. Kindly help.It is a simple strategy. Buy when the close is above 50 DMA but on 5 minutes candle. How to do this? EOD is possible and I know how to do that.
Thanks
How can I get the 50 ma value but on 5 minutes candle? Is this even possible?
Thanks
Hi, SPH,
Sorry! I’m not familiar with the 5-minute candles trading strategy.
Hi Prashanth,
Thanks a lot for this very informative piece. I am struggling with getting quotes for NSE-SME listed stocks. The stock in question is “Thejo Engineering”.
Is there a way to collect the quote in Google sheet (it is working fine or all NSE and BSE quotes)
Hi, Rudra,
In my search the ticker NSE:THEJO not found on the https://www.google.com/finance website.
Trying to get the price of BOM:533030, “Isgec Heavy Engineering Ltd”. Not getting the price!
Hi, Gaurav Gaur,
It seems the ticker symbol for the said company is “533033”. Please cross-check.
=GOOGLEFINANCE("BOM:533033","PRICE")
The Volume formula is not working for BSE and NSE. Is there any other way to arrive at “volume” or “volumeavg”?
Hi, Amith C,
It’s working for me with the ticker “HDFCBANK”.
Eg.:
=GOOGLEFINANCE("NSE:HDFCBANK","VOLUME")
But I couldn’t get the VOLUMEAVG. I think it’s the “symbol” (ticker) specific.
How do I get the minimum value(price) in the historical data, say from 1st Mar 2020 – 30 Apr 2020?
Hi, Kailash,
Here is one example.
=query(GOOGLEFINANCE("GOOG", "price", DATE(2020,3,1), DATE(2020,4,30), "DAILY"),"select * order by Col2 asc limit 1",1)
Query sorts (ORDER BY clause) the closing price column in ascending order. So the min closing value for the said period will be on the top. The LIMIT clause limits the rows to 1 (excluding headers).
New to Query?
Learn Query function with examples in Google Sheets.
What is the formula of the Exponential Moving Average (EMA) in Google Sheets?
How it can be used to calculate the Share market stock EMA of different periods. Eg 5, 21, 50 Days.
Can anyone share the demo sheet?
Thanks a lot for your valuable solution.
Regards,
Amarjeet Singh
Hi!
As per the links provided in your Excel Sheet, I’ve prepared a watch list of some companies in my new Excel Sheet. But after preparing a draft for one company in all respects, as I try to copy the same formula in other cells, it doesn’t change automatically. I have to put a cell reference for each row manually.
Please suggest an Excel formula to put in one click for column/row.
Regards
Amarjeet Singh
Hi, Amarjeet Singh,
It’s because the cell reference may be an absolute cell reference. Please make it relative. See the below example.
Absolute:
=IFERROR(GOOGLEFINANCE($A$1,"PRICE"))
Relative:
=IFERROR(GOOGLEFINANCE(A1,"PRICE"))
Can anyone please help with the formula for Dividend Yield for Reliance.
Thanks
The dividend rate would be indeed super handy (the exact yield obviously will vary based on when and how many purchases were made) Is there a formula for the rate?
Hi, Markus,
Please check this official documentation for more info.
https://support.google.com/docs/answer/3093281?hl=en-GB
In the google spreadsheet, I am getting today’s high and low instead of 52-week high & low for shares on NSE. Please help.
Check whether you have used the correct arguments. In my test with the ticker ‘HDFCBANK’, it seems working correctly.
Thanks for your prompt reply. At some places, it is picking wrong 52 week low prices. Otherwise, it is working.
Mohan
Unfortunately, we users have no control over that 🙁
I have modified the post and included a link to their (Google Finance) ‘Disclaimer’ page (see the fourth para). Please read and understand that.
Hai, I need to see 10-day high & 10-day low along with Vol multiple. Could you please help me out with the formula???
Thanks in advance.
Not sure, here are some hits.
High:
=GOOGLEFINANCE("GOOG","high",TODAY()-10,TODAY())
Low:
=GOOGLEFINANCE("GOOG","low",TODAY()-10,TODAY())
Volume:
=GOOGLEFINANCE("GOOG","volume",TODAY()-10,TODAY())
Best,
It’s working. However, it is counting non-working days too. How to get the highest of 10 working days alone.
Hi, Sai Venkatesh,
In that case, we can populate the highest 30 days data and filter it for exact 10 days.
The below Query together with GOOGLEFINANCE will do the filtering part.
=query(GOOGLEFINANCE("GOOG","high",TODAY()-30,TODAY()),"Select * order by Col1 Desc limit 10")
Best,
The function GOOGLEFINANCE(“JETAIRWAYS”,”beta”) doesn’t work. Any thoughts around what could be the problem?
Hi, Suvajit,
No Idea. GoogleFinance has issues like this often. The tooltip says “Function GOOGLEFINANCE parameter 2 value is invalid for the symbol specified”.
I could only find the below ticker working!
=googlefinance("GOOG","beta")
🙁
Use your Google Sheets to report the issue.
Best,
Hi Prashanth,
I tried spreadsheet today.
Got price using following formula: “=GOOGLEFINANCE(A2)”
It gets the price but seems like it is delayed. Also, I do not think it refreshes automatically. Can you please tell me what is happening here?
Also, when I tried to get
"datadelay" (=GOOGLEFINANCE(A2,"datadelay"))
, it shows 0 which means there is no delay in data but I think there is. Can you please comment on this as well?Can you also suggest me some tutorial link or document which contains all the basic as well as advanced formulas like the one you have used to get swings in price over 200 days?
Hi, Vivek,
Google Finance function is well documented over here – https://support.google.com/docs/answer/3093281
It says;
Check this too.
https://infoinspired.com/google-docs/spreadsheet/how-to-use-the-googlefinance-function-in-google-sheets/
Thanks
Prashanth, many thanks for your helpful tutorial. Do you know how I can calculate the maximum difference between “closeyest” and “priceopen” over a 200 days range? In essence, I want to calculate when a stock swing in prices between the closing price and opening, what is the maximum swing over a 200 days period.
Hi, Donaldo,
The GoogleFinance function does not support “closeyest” attribute to extract historical data. So as a workaround we can use the attributes “open” and “close”.
={GOOGLEFINANCE("NSE:HINDALCO","close",TODAY()-200,today()-2),
GOOGLEFINANCE("NSE:HINDALCO","open",TODAY()-199,today())}
If this formula is in Cell A2, apply the following formula in cell E2.
={"Swing in Price";ArrayFormula(if(len(A3:A),B3:B-D3:D,))}
If you find any error, split the first GoogleFincance formula and paste the first split one in cell A2 and the second split one in cell C2.
Use a Column graph then. I have presented the same in this sheet.
Link
Thanks.
The volume avg is not calculated in your spreadsheet. I am also facing an issue with its calculation. Please help.
Hi, Ujjawal,
I have clearly mentioned that it’s not available all the time. I have the formula in place in row # B14 and D14.
How do I share the live tracker with others without sharing the formulas in it?