0
votes

I am working on a spreadsheet in google sheets that tries to do the following.

  1. Retrieves a table by scraping a website.
  2. Uses a query within that table to retrieve a specific value in the table.
  3. Uses an existing cell in the spreadsheet to determine the value to match.

You can see the spreadsheet here. Cell D2 is the one in question. It attempts to use the C2 value to build a query. It doesn't work for some reason. I believe I have the correct syntax, but I'm not sure. Directly below in Cell D3 is the same formula with the value directly entered rather than referring to the cell.

I am getting an error that says "query completed with an empty output", which doesn't make sense to me when it works with the value directly inputted.

1

1 Answers

0
votes

I figured this out, I was using the syntax incorrectly. The correct formula goes like this.

=query(importhtml(B2,"table",1),"select Col4 where Col8 ="&C2,1)

I imagine it was throwing an error because the second & symbol would lead it to believe that more text was coming and there was none.