6

I'm currently using IMPORTHTML to import tables from a website that have five columns and three rows. But, I only need three cells from each of these tables. Is there a way to import just these three cells into my spreadsheet, rather than the entire table?

I could use INDEX(IMPORTHTML, but due to the number of IMPORHTML functions my spreadsheet is using, I fear it would slow it down even further than it already is if I triple that amount.

1
  • You're asking which cells in the table that I want? The cells are R2C4, R2C5, and R3C1 before importing.
    – Gnrl Kitty
    Commented Dec 2, 2017 at 2:40

5 Answers 5

4

pretty much possible:

=INDEX(IMPORTHTML("https://geizhals.de/?fs="&A1&"&in=";"table";0);2;3)

this one shall search for a phrase located in cell A1 and it will return data from a table 0, but only from a row 2 of that table and from a cell 3 of that row. in your case:

=INDEX(IMPORTHTML("siteurl";"TABLE";number);rownumber;cellnumber)
_________________________________________________________________

=INDEX(IMPORTHTML("siteurl";"TABLE";number);2;4)
=INDEX(IMPORTHTML("siteurl";"TABLE";number);2;5)
=INDEX(IMPORTHTML("siteurl";"TABLE";number);3;1)
  • if you are afraid of slowdown then import it into a new spreadsheet and then use IMPORTRANGE in the final spreadsheet to import it from "Google side"
0

You can append the QUERY function to select only the Columns or Rows needed.

1
  • Using QUERY is similar to use INDEX; they increase formula complexity and probably increase recalculation time. Commented Mar 22, 2018 at 22:23
0

IMPORTHTML only imports complete lists or complete tables; it's not able to import only one element of the list either only one cell of the table.

One alternative is to use IMPORTXML but it only will work if your cell is part of a well-formed path (XPath)

0

You can use this example to implement to your case:

=query({IMPORTHTML("https://www.bloomberg.com/markets/currencies","table")},"select Col1,Col2",1)
0

This is what I tried with success:

=INDEX(IMPORTHTML("https://en.wikipedia.org/wiki/List_of_highest-grossing_films","table",1),,3)

The ,3 imports column 3 only add other column numbers with 1,2,3,4 etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.