user3197575
user3197575

Reputation: 277

How to show a date comes after a date X excel?

How do I check if a date in date format is greater than another?

For instance, date in date format in A1:2014-01-02 and B1:2014-07-07

How do show that the date in B1( 2014-07-07) comes after the date in A1(2014-01-02)?

I tried doing this: if(A1<B1;1;0)

Upvotes: 0

Views: 44

Answers (2)

Cherry
Cherry

Reputation: 393

Hey the problem was using the ; instead of ,

So Change it to

if(A1 < B1,1,0)

Upvotes: 0

CallumDA
CallumDA

Reputation: 12113

Simply:

=IF(A1<B1,"Before","After")

Or for more rigorous logic

=IF(A1<B1,"Before", IF(A1=B1,"Same","After"))

Alternatively, to return the later date

=IF(A1<B1,B1,A1)

Upvotes: 1

Related Questions