首页 > 解决方案 > 如何在 Google 表格中设置跨多个工作表的多个条件的 QUERY 公式?

问题描述

我有 3 个工作表名称“alex”、“shawn”和“taki”。所有的列相同但行号不同

在新工作表(仪表板)上,我希望查询显示列 A 到 F,但条件为 col L = NOT 'case closed' 和 col A = date range(我放在 c23 和 e23 处)

标签: google-sheetsgoogle-sheets-query

解决方案


尝试这个:

=QUERY({alex!A:Z; shawn!A:Z; taki!A:Z}, 
 "select Col1,Col2,Col3,Col4,Col5,Col6 
  where not Col12 = 'case closed' 
    and Col1 <= date '"&TEXT(C23, "yyyy-mm-dd")&"'
    and Col1 >= date '"&TEXT(E23, "yyyy-mm-dd")&"'", 0)

推荐阅读