QUERY syntax using cell reference

后端 未结 8 1515
隐瞒了意图╮
隐瞒了意图╮ 2020-12-23 21:46

I\'m having trouble figuring out a fairly simple QUERY statement in Google Spreadsheets. I\'m trying to use a cell reference instead of static values and I\'m running into t

8条回答
  •  生来不讨喜
    2020-12-23 22:15

    I only have a workaround here. In this special case, I would use the FILTER function instead of QUERY:

    =FILTER(Responses!B:B,Responses!G:G=B1)
    

    Assuming that your data is on the "Responses" sheet, but your condition (cell reference) is in the actual sheet's B1 cell.

    Hope it helps.

    UPDATE:

    After some search for the original question: The problem with your formula is definitely the second & sign which assumes that you would like to concatenate something more to your WHERE statement. Try to remove it. If it still doesn't work, then try this:

    =QUERY(Responses!B1:I, "Select B where G matches '^.\*($" & B1 & ").\*$'") - I have not tried it, but it helped in another post: Query with range of values for WHERE clause?

提交回复
热议问题