How to Get Real-Time BSE and NSE Stock Prices in Google Sheets

Published on

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!

Sample Sheet

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.

Google Finance: Finding Ticker Symbol for Formula

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.

Getting Real-Time BSE and NSE Stock Prices in Google Sheets

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:

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

How to Create a Searchable Table in Excel Using the FILTER Function

Finding specific records, or rows containing the required information, is straightforward in Excel using...

Time Sequences in Excel by Minute, Hour, or Second Increments

Creating time sequences, whether by hour, minute, or second increments in Excel, can be...

Finding Most Frequent Text in Excel with Dynamic Array Formulas

Looking to identify the most frequently occurring text in Excel? You can do this...

Hierarchical Numbering Sequences in Excel

Creating hierarchical numbering sequences in an Excel spreadsheet can significantly improve the way you...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

53 COMMENTS

  1. Hi Prashanth,

    =GOOGLEFINANCE("BOM:539686","PRICE") for KP Energy is not returning the values. What could be the reason?

    Thanks in advance!

  2. Hello Prashanth,

    I’m having trouble using the beta function. Could you please double-check it from your end?

    Thanks

  3. 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"))))

  4. 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.

  5. 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

  6. 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.

  7. 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

  8. 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, 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.

  9. 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?

  10. 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"))

  11. 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,

        • 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,

    • 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,

  12. 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?

  13. 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.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.