I am trying to create a calculated column based on a date comparison. This should be a simple if else block condition but its driving me nuts. I have a date column called "Expiration Date" and I am trying to add a calculated column as follows: If the Expiration date value matches today's date then calculated column value will be "Expired" else "Valid".

Can someone please help me out with the formula,thanks in advance.

up vote 3 down vote accepted

The calculated column formula as below.

=IF(ISBLANK([Expiration Date]), "", If([Expiration Date]<=Now()+1,"Expired","Valid"))

enter image description here

  • 1
    Thanks so much, one issue I am seeing is, in a scenario when Expiration date column is null then also calculated field shows value as Expired, in theory if expiration date is null then calculated column should also be left blank. Can you help? – mdevm Nov 9 at 2:02
  • I modify the reply above, check it. – LZ_MSFT Nov 9 at 2:21

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.