3

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
    Instead of IMPORTHTML try IMPORTXML – Rubén Nov 8 '17 at 19:52
  • You're asking which cells in the table that I want? The cells are R2C4, R2C5, and R3C1 before importing. – Gnrl Kitty Dec 2 '17 at 2:40
2

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.

  • Using QUERY is similar to use INDEX; they increase formula complexity and probably increase recalculation time. – Rubén Mar 22 '18 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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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