Date Google sheets查询两个日期之间的总和

Date Google sheets查询两个日期之间的总和,date,google-sheets,sum,google-sheets-formula,google-sheets-query,Date,Google Sheets,Sum,Google Sheets Formula,Google Sheets Query,我有一个像这样的电子表格 2020-04-25 63 2020-04-26 34 2020-04-27 12 2020-04-28 33 2020-04-29 45 2020-04-30 10 2020-05-01 34 2020-05-02 12 2020-05-03 45 2020-05-04 18 2020-05-05 45 2020-05-06 21 2020-05-07 34 2020-05-08 56 2020-05-09 21 是否可以使用googl

我有一个像这样的电子表格

2020-04-25  63
2020-04-26  34
2020-04-27  12
2020-04-28  33
2020-04-29  45
2020-04-30  10
2020-05-01  34
2020-05-02  12
2020-05-03  45
2020-05-04  18
2020-05-05  45
2020-05-06  21
2020-05-07  34
2020-05-08  56
2020-05-09  21
是否可以使用google sheets查询来计算两个日期之间的总数,即2020-05-01和2020-05-05之间的总数为154


我知道可以搜索大于/小于日期,但不确定如何合计返回的总数?

假设A列中有日期,请尝试

=query(A2:B, "Select sum(B) where A >= date '2020-05-01' and A <= date '2020-05-05' label sum(B)''", 0)
或者,使用sumproduct:

=sumproduct(A2:A>=date(2020, 5, 1), A2:A<=date(2020, 5, 5), B2:B)
或者,使用sumifs:

=sumifs(B2:B, A2:A, ">="&date(2020, 5, 1), A2:A, "<="&date(2020, 5, 5))

假设A列中有日期,请尝试

=query(A2:B, "Select sum(B) where A >= date '2020-05-01' and A <= date '2020-05-05' label sum(B)''", 0)
或者,使用sumproduct:

=sumproduct(A2:A>=date(2020, 5, 1), A2:A<=date(2020, 5, 5), B2:B)
或者,使用sumifs:

=sumifs(B2:B, A2:A, ">="&date(2020, 5, 1), A2:A, "<="&date(2020, 5, 5))
尝试:

尝试: