简体   繁体   English

如何在Google表格中的arrayformula sumifs中增加日期?

[英]How to increment date in arrayformula sumifs in google sheets?

I have adapted a formula from another post and it works, yet I need to increment the formula down hundreds of rows, but I cannot figure out how to get the dates to increase. 我已经从另一篇文章改编了一个公式,该公式仍然有效,但是我需要将该公式向下增加几百行,但是我无法弄清楚如何增加日期。

I have a Google Form that sends data to its spreadsheet. 我有一个Google表单,可将​​数据发送到其电子表格。 There may be several entries per date and I want the data to be summed on the 2nd sheet before I graph it. 每个日期可能有几个条目,我希望在绘制图表之前将数据汇总到第二张纸上。

Data
 A                     B
6/3/2016 06:06:00      2
6/3/2016 11:06:00      2
6/4/2016 07:05:00      1
6/4/2016 09:10:00      5

Result
 A   B
6/3  4
6/4  

B2 =ArrayFormula(SUM(If((Data!A$2:A<DATE(2016,6,5))*(Data!A$2:A>DATE(2016,6,4)),Data!B$2:B)))

I will have dates that run the entire year, so I need an easy way to increment the dates. 我将使用整年的日期,因此我需要一种简单的方法来增加日期。 Also, if you have a way to grab data from the exact date needed, that would be nice too (instead of giving the date range). 另外,如果您有一种方法可以从所需的确切日期中获取数据,那也很好(而不是提供日期范围)。

A query formula may work better in this example, such as: 在此示例中,查询公式可能会更好地工作,例如:

=QUERY({ARRAYFORMULA(TRUNC('Form responses 1'!A2:A)),'Form responses 1'!B2:B},"select Col1,sum(Col2) where Col1 >0 group by Col1 label Col1'Date' format Col1 'mm-dd'")

Amend the sheet name and ranges as appropriate 适当修改工作表名称和范围

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM