【问题标题】:Query timestamps in Google Sheets looking for specific date but ignoring the time查询 Google 表格中的时间戳以查找特定日期但忽略时间
【发布时间】:2019-04-23 04:24:56
【问题描述】:

我在第一列中有一个带有时间戳的数据范围。我想要特定日期的特定列 (AF) 的平均值,无论时间戳是什么时间。

我目前正在处理的公式看起来像这样,但它返回一个空结果集,尽管我可以看到数据存在。

=query(ImportedData1!A1:AF, "Select avg(AF) where A = date '2019-04-08' label avg(AF) '' ", 0)

请问我做错了什么?

【问题讨论】:

    标签: date datetime google-sheets google-query-language


    【解决方案1】:

    看看有没有帮助

    =query(ImportedData1!A1:AF, "Select avg(AF) where toDate(A) = date '2019-04-08' label avg(AF) '' ", 0)
    

    【讨论】:

      【解决方案2】:
      =AVERAGE(FILTER(ImportedData1!AF:AF, 
       INDEX(SPLIT(ImportedData1!A:A, " "), ,1) = DATE(2019, 4, 8)))
      

      =ARRAYFORMULA(AVERAGE(FILTER(ImportedData1!AF:AF, 
       LEFT(ImportedData1!A:A, 10) = "08/04/2019")))
      

      【讨论】:

        猜你喜欢
        • 2013-10-22
        • 1970-01-01
        • 2011-04-30
        • 2013-10-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-07-08
        相关资源
        最近更新 更多