Compare two dates - Return an "expired" comment

Ironman5089

New Member
Joined
Oct 8, 2019
Messages
4
I am trying to compare the date in D4 with date in N4. If date in D4 is greater than N4, I want a comment "Expired".
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi & welcome to MrExcel.
How about
=IF(D4>N4,"Expired","ok")
 
Upvote 0
Thanks, however this didn't work. I changed the date in D4 to be newer then that in N4 and "Ok" still reads in the cell, when it should read expired.
 
Upvote 0
It works for me


Book1
DEFGHIJKLMN
420/09/2019ok25/09/2019
527/09/2019Expired25/09/2019
Lists
Cell Formulas
RangeFormula
I4=IF(D4>N4,"Expired","ok")


Do you have calculation set to automatic, or manual?
 
Upvote 0
and check if your dates are as text or real excel dates

=ISNUMBER(D4) should be TRUE
=ISNUMBER(N4) should be TRUE
 
Last edited:
Upvote 0
It works for me

DEFGHIJKLMN
420/09/2019ok25/09/2019
527/09/2019Expired25/09/2019

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Lists

Worksheet Formulas
CellFormula
I4=IF(D4>N4,"Expired","ok")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Do you have calculation set to automatic, or manual?

Ok, Now it went through. Thought I was loosing my mind. Thanks
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,416
Members
448,960
Latest member
AKSMITH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top