Google-sheets – Problem with QUERY(IMPORTRANGE()) to retrieve data

formulasgoogle sheetsgoogle-sheets-query

Iā€™m having a problem with the =QUERY(IMPORTRANGE()) formula while retrieving a column data from one spreadsheet to another.

=QUERY(IMPORTRANGE("spreedsheetURL","Sheet1!A2"),"select Col2 WHERE Col1 Contains B3")

I want to retrieve data from the column2 spreadsheet(A) to column2 spreadsheet(B)
where column1 spreadsheet(A) is equal to the column1 spreadsheet(B).

The error I get is:

Formula parse error.

Best Answer

=QUERY(IMPORTRANGE("URL"; "Sheet1!A2:B"); "select Col2 where Col1 contains '"&B3&"'"; 0)