[英]Excel - COUNTIFS comparing dates does not return any values
After searching through hundreds of COUNTIFS
questions, I can't find the answer, so please bear with me. 在搜索了数百个
COUNTIFS
问题之后,我找不到答案,因此请耐心等待。
I want to count the number of projects where State=Completed AND Actual End Date is Less Than Planned Finish. 我想计算State = Completed并且实际结束日期小于计划完成的项目数。
This statement works: =COUNTIFS(Table1[State],"Completed",Table1[Actual End Date],">0")
(value = 75) 该语句有效:
=COUNTIFS(Table1[State],"Completed",Table1[Actual End Date],">0")
(值= 75)
Changing the 2nd criteria though returns 0: =COUNTIFS(Table1[State],"Completed",Table1[Actual End Date],"<="&Table1[Planned Finish])
更改第二个条件虽然会返回0:
=COUNTIFS(Table1[State],"Completed",Table1[Actual End Date],"<="&Table1[Planned Finish])
Actual value should be 31 (obtained via a helper column) but I'd like to avoid the helper column if possible - and I think that it is possible, I'm just not sure how to do so. 实际值应为31(可通过helper列获取),但我想尽可能避免使用helper列-而且我认为有可能,但我不确定该怎么做。
The criteria cannot be a range, it must be a single value. 条件不能是范围,它必须是单个值。 COUNTIFS will not work for that reason.
因此,COUNTIFS将无法使用。
Use SUMPRODUCT: 使用SUMPRODUCT:
=SUMPRODUCT((Table1[State]="Completed")*(Table1[Actual End Date]<=Table1[Planned Finish]))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.