Search code examples
google-sheetsgoogle-sheets-query

Trouble with ImportHTML


I'm trying to use =IMPORTHTML and am having trouble making it work.
Here is what I have so far

=INDEX(IMPORTHTML("https://finviz.com/screener.ashx?v=111&f=cap_mid,fa_curratio_o1,fa_pe_u15,fa_roe_o20,fa_roi_o15&ft=2","table",15),3,3)

I am sure about the table number, but I keep getting errors saying that my index values are invalid because they should be between 1 and 0 which doesn't make sense to me.

Furthermore, I am looking to import the whole table and if I only use the =IMPORTHTML it says I need the =INDEX function. Is there a way to import the whole thing or do I have to do it manually?


Solution

  • =QUERY(IMPORTHTML(
     "https://finviz.com/screener.ashx?v=111&f=cap_mid,fa_
      curratio_o1,fa_pe_u15,fa_roe_o20,fa_roi_o15&ft=2",
     "table", 13), "Select Col2, Col4, Col5, Col7, Col8")