Excel Countif Date in column A is greater than column B [closed]

╄→尐↘猪︶ㄣ 提交于 2019-12-21 03:48:29

问题


Columns A and B both have dates. If the date in column A is greater than the date in the same row of column B, the row should be counted. To add context, I am trying to count the number of rows where the completion date is past the due date. How can this be accomplished?

Thanks.


回答1:


You can try this:

=SUMPRODUCT(--(A:A>B:B))

It will sum all instances in the range where the date in column A is greater than that in column B.

You can also do this, however it needs to be entered as an array formula (Ctrl+Shift+Enter):

=SUM(IF(A:A>B:B,1,0))



回答2:


Create a column that has a function to perform the comparison, e.g. =A1 > B1. This will give you a column that contains TRUE or FALSE for your comparison. Then you can use the COUNTIF function to count the results of this function, e.g. =COUNTIF(C:C, "=TRUE").




回答3:


I would add a new additional column (say C) which should have this formula =IF(A1>B1; 1; 0). Then you can add a new cell =SUM(C:C) to get the result number.



来源:https://stackoverflow.com/questions/14045332/excel-countif-date-in-column-a-is-greater-than-column-b

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!