Excel Countif Date in column A is greater than column B

spassen picture spassen · Dec 26, 2012 · Viewed 37k times · Source

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.

Answer

RocketDonkey picture RocketDonkey · Dec 26, 2012

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))