Excel 中两个日期和时间之间的 SUMIFS

SUMIFS Between Two Dates and Times in Excel

我正在尝试获取两个日期和两个时间之间的列的总和,其中日期不同。

我的专栏是:

Table 1 = 时间 1、时间 2、日期 1、日期 2

Table 2 = 日期、时间、事件

理想情况下,此公式将给出 Date1/Time1 和 Date2/Time2

之间的事件总数

我已经尝试了下面的公式,但我收到的是这两个日期之间的事件总数,而不是这两个日期之间的事件数。

Time Start  Time End    Date Start  Date End
23:54:00    0:04:00     9/27/2021   9/28/2021

=SUMIFS(Sheet1!$G:$G,Sheet1!$D:$D,">="&'ProductMadness-Postlogs Export'!U84,Sheet1!$D:$D,"<="&'ProductMadness-Postlogs Export'!V84,,Sheet1!$C:$C,">="&'ProductMadness-Postlogs Export'!Y84,Sheet1!$C:$C,"<="&'ProductMadness-Postlogs Export'!Z84)

*对于上下文,Sheet1 具有事件数据,“ProductMadness - Postlogs”具有日期和时间数据

如果我理解正确,下面的公式应该就是您要查找的内容。

=SUMIFS(Sheet1!$G:$G,Sheet1!$D:$D,">"&'ProductMadness-Postlogs Export'!U84,Sheet1!$D:$D,"<"&'ProductMadness-Postlogs Export'!V84,Sheet1!$C:$C,">"&'ProductMadness-Postlogs Export'!Y84,Sheet1!$C:$C,"<"&'ProductMadness-Postlogs Export'!Z84)

通过排除等于,它只计算介于两者之间的值。话虽这么说,这仍然可能无法满足您的需求,具体取决于时间是否只是时间值。例如,23:54:00 大于 0:04:00。由于您过去收到过结果,我假设您的时间具有完整的日期值并且只是格式化为时间。