【问题标题】:Google Sheets Query across sheets using checkboxes to limit results使用复选框限制结果的 Google 表格跨表格查询
【发布时间】:2019-07-01 19:08:17
【问题描述】:

我正在 Google 表格中制作一个迷你搜索引擎。我有 3 张纸(6 年级、7 年级、8 年级)的信息。 过去,我有一张组合表,它将每张表中的信息组合在一起。但是,当我为 1-5 年级添加额外的表格时,返回的信息量会过多。我想让用户使用复选框来确定他们想要的成绩。

这里是workbook。 我通过复制 6 年级、7 年级和 8 年级的数据为所有年级添加了表格。拿到手后,数据的格式就和以前一样了。

这是我一直在玩的公式:

=iferror(If(D2=True,Query(
             Kindergarten!A:I,"Select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 
            ),
      Query(
             {Kindergarten!A:I;'1st'!A:I;'2nd'!A:I},"Select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 
            ),
      "No Matches, try a different search"))

【问题讨论】:

    标签: if-statement google-sheets google-sheets-formula google-sheets-query google-query-language


    【解决方案1】:

    您没有在“搜索”单元格中提及要搜索的内容,但公式为:

    =IFERROR(QUERY({
     IF(D2=TRUE, IFERROR(QUERY({Kindergarten!A:I},    "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""}); 
     IF(E2=TRUE, IFERROR(QUERY({'1st'!A:I},           "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""});
     IF(F2=TRUE, IFERROR(QUERY({'2nd'!A:I},           "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""});
     IF(G2=TRUE, IFERROR(QUERY({'3rd'!A:I},           "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""});
     IF(H2=TRUE, IFERROR(QUERY({'4th'!A:I},           "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""});
     IF(C4=TRUE, IFERROR(QUERY({'5th'!A:I},           "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""});
     IF(D4=TRUE, IFERROR(QUERY({'6th'!A:I},           "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""});
     IF(E4=TRUE, IFERROR(QUERY({'7th'!A:I},           "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""});
     IF(F4=TRUE, IFERROR(QUERY({'8th'!A:I},           "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""});
     IF(G4=TRUE, IFERROR(QUERY({'9th and 10th'!A:I},  "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""});
     IF(H4=TRUE, IFERROR(QUERY({'11th and 12th'!A:I}, "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8 where Col9>0", 0), {"","","","","","","",""}), {"","","","","","","",""})},
     "where Col1 is not null", 0), "No Matches, try a different search")
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-15
      • 2022-11-02
      • 2019-07-20
      相关资源
      最近更新 更多