id status date time
a received 01-Jan-14 04:00
a available 05-Jan-14 05:00
a returned 06-Jan-14 13:00
a destroyed 07-Jan-14 12:00
b received 10-Jan-14 14:00
b available 11-Jan-14 08:00
b returned 12-Jan-14 09:00
b destroyed 13-Jan-14 07:00
c received 02-Jan-14 05:00
c available 03-Jan-14 07:00
c returned 05-Jan-14 08:00
d received 09-Jan-14 02:00
d available 12-Jan-14 06:00
(etc)
我有唯一的id
个,每个都有status
,date
和time
。对于给定的日期/时间,我需要计算available
个。对于给定的日期/时间,我需要计算received
个。我打算在给定的单元格中输入日期和时间,并根据该日期和时间进行这些计数。
即。 January 3, 2014 06:00
,已收到2
received
和0
available
小部件[a
,但尚未提供;已收到c
但尚未提供]。
如何将其作为Excel公式执行?
答案 0 :(得分:0)
假设01=Jan-14
采用日期格式且在C2中,F1包含January 3, 2014 06:00
的日期格式,available
始终与received
配对,并紧随其后,并且您拥有在E2中连接并复制下来:
=C2+D2
然后对于available
,请尝试:
=COUNTIFS(B2:B100,"received",E2:E100,"<"&F1,B3:B101,"available",E3:E101,"<"&F1)
和received
:
=COUNTIFS(B:B,"received",E:E,"<"&F1)
前者的范围超出Rows100 / 101以适应。