使用Checkbox作为搜索条件的Google表格查询

时间:2019-06-28 19:19:17

标签: checkbox google-sheets google-sheets-formula google-sheets-query google-query-language

我想在Google表格中使用一个查询,让我查看一列复选框以筛选已选中的复选框(TRUE)。

=QUERY(Available!$A$3:$O, "select A,B,C,D,E,F,G,H,I,J,K,L,M,N,O where O = '"& TEXT(TRUE) &"' and B > 100,000 order by B desc")

它抱怨字面值,但是我在确定正确的语法以确保查询正确读取复选框方面遇到很多麻烦。

1 个答案:

答案 0 :(得分:1)

像这样尝试:

=QUERY(Available!A3:O, 
 "where O = TRUE 
    and B > 100000 
  order by B desc")

如果范围是 A:O ,并且您不需要所有列select A,B,C,D,E,F,G,H,I,J,K,L,M,N,O

TRUE也是布尔值,因此无需将其视为TEXT


要修复ARRAY_LITERAL错误,您需要构建如下公式:

={IFERROR(QUERY(Available!A2:O, "select A,B,C,D,E,F,G,H,I,J,K,L,M where M like '%(Blah)' order by B desc"), 
  {"1","","","","","","","","","","","",""}); 
  IFERROR(QUERY(Available!A2:O, "select A,B,C,D,E,F,G,H,I,J,K,L,M where C = 'BlehBleh' order by B desc limit 7"), 
  {"2","","","","","","","","","","","",""}); 
  IFERROR(QUERY(Available!A2:O, "select A,B,C,D,E,F,G,H,I,J,K,L,M where O = TRUE and B > 100000 order by B desc"), 
  {"3","","","","","","","","","","","",""})}