2

Is there a way to print out the GICS sector name for a specific share/ETF symbol in google sheets using the GOOGLEFINANCE commands or any other way?

Many thanks

mindbomb
  • 1,642
  • 4
  • 20
  • 35

3 Answers3

3

I used this site to find several scraping methods to get data from finviz. https://decodingmarkets.com/scrape-stock-data-from-finviz/

Extending their logic, I was able to get the company name, and the combined sector/subsector codes

(I originally used the website's scraping techniques to get Dividend data that GoogleFinance formula lacks...)

This formula gets the company name using US ticker symbol in cell C3:

=SUBSTITUTE(INDEX(IMPORTHTML("http://finviz.com/quote.ashx?t="&C3,"table",6),2,1),"*","")

Through trial and error, I found that table 6 has name and sectors. I then referenced the 2nd row and 1st column to get the name. I found that row 3, column 1 has the sector, subsector and country combined as one value. They use a pipe | delimiter for each break.

Using the split function, I was able to split segment.

=SPLIT(SUBSTITUTE(INDEX(IMPORTHTML("http://finviz.com/quote.ashx?t="&C3,"table",6),3,1),"*",""),"|",true,true)
Joman68
  • 2,248
  • 3
  • 34
  • 36
Walter
  • 31
  • 2
1

Its not available from Sheets

Check out the official docs:

https://support.google.com/docs/answer/3093281?hl=en

It has a lot of options but unfortunately, not that one.

If you think it would be useful, then make sure you file a feature request @

https://developers.google.com/issue-tracker

As for any other way

@GSee said it best here: https://stackoverflow.com/a/16525782/10445017

iansedano
  • 6,169
  • 2
  • 12
  • 24
0

If want to get the details in one column then may use this formula.

=IF(ISBLANK($A5),"-", CONCATENATE ( SUBSTITUTE(INDEX(IMPORTHTML("https://finviz.com/quote.ashx?t="&A5,"table",8),2,1),"*","")))

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 31 '23 at 00:22