简体   繁体   中英

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?

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.

=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 ';').

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM