FlorianT.
FlorianT.

Reputation: 873

How to use query with spreadsheet and relative cell reference

PROBLEM: I am trying to use queries in google spreadsheets with a relative cell reference. What I am trying to do: Filter a spreadsheet tab 'website!' for the content in a cell 'Dashboard Table!$B$1' and give the content of the whole row in the sheet 'website!'.

Here is my original formular without queries: =IF(isblank($B$1), ARRAYFORMULA(Website!A16:D1000), FILTER(Website!A16:D$1000, Website!$C16:$C$1000=$B$1)) that worked fine.

What I am trying now: =QUERY(Website!A16:D, "select A WHERE C="&B1&"", -1) not working at all returning #value!.

Sorry I am new to queries. Can anyone advice?

Upvotes: 1

Views: 2354

Answers (2)

Levent Onder
Levent Onder

Reputation: 1

=QUERY(sheet1!1:999;"SELECT * WHERE F contains '"&$A$1&"' ";1)

Just copy formula to A2 cell.

When you write something in A1 cell and hit enter it finds everything in sheet1 that contains A1 cell.

Worked for me (some computers use comma, instead of this ';').

Upvotes: 0

FlorianT.
FlorianT.

Reputation: 873

Ok, so what did it for me is:

=QUERY(Website!$A16:$D, "select A WHERE (C='"&$B$1&"' OR B contains '"&$B$1&"')", -1)

Problem was the order in which I had the " and '... I guess that depends on the language you set your google spreadsheets in.

Upvotes: 0

Related Questions