【问题标题】:Google Sheets QUERY count returning 'count' instead of numeric value谷歌表格查询计数返回“计数”而不是数值
【发布时间】:2019-04-01 20:36:33
【问题描述】:

第一次查询用户所以请原谅菜鸟问题。我有一个带有多个标签的 Google 表格(文档)。我正在尝试查询包含工作表中的选项卡。我发现不需要IMPORTRANGE,因为数据来自同一来源(如果我错了,请纠正我)。

查询,获取指定月份和年份的计数。 emp1 是选项卡名称源的数据:

  =QUERY('emp1'!B2:B,"Select COUNT(B) where month(B)=3 and year(B)=2019",0)

示例行数据(B2 为起始数据行,跳过标题 B1):

    A    B                 C           D            E
  Index Date        Company Name    Account #   Verified (Y/N)
      1 2019-03-15  ABC             5362        Y

【问题讨论】:

    标签: google-sheets google-query-language


    【解决方案1】:

    QUERY 中的month 从 0 开始,但没有零月份(Jan 为 1),因此您需要 +1 更正。这样做:

    =COUNTA(IFERROR(QUERY(emp1!B2:B, "where month(B)+1=3 and year(B)=2019", 0)))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-13
      • 2022-12-31
      相关资源
      最近更新 更多