Figure out 6 months left, 3 months left, from a date

Carlos5

Board Regular
Joined
Jan 14, 2015
Messages
58
Hello,
I am trying to set up a "flag" that will tell me when a date will expire (two years from the original date.) i.e. date is 5/15/21 and it expires in two years on 5/15/23. I would like to set a tag that shows when it is 6 months to expiry and 3 months to expiry (based on the current date.) I can't make the logic work. In text I think like this: If today minus 6 months is greater than 5/15/23 than say "6 months to expiry", if today minus 3 months is greater than 5/15/23 than say "3 months to expiry" and if today = or is less than 5/15/23 than say "expired".
I hope that makes sense and someone can help me.
Thanks,
Carlos
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Try this:

=LOOKUP(TODAY(),EDATE(A2,{0,18,21,24}),{"","6 months to expiry","3 months to expiry","expired"})
 
Upvote 0
Solution
Try this:

=LOOKUP(TODAY(),EDATE(A2,{0,18,21,24}),{"","6 months to expiry","3 months to expiry","expired"})
That looks like it did the trick. Thank you!
A couple of questions if you don't mind, so I can learn a little. 1.) what does the lookup function do in this case, why is it needed? 2.) what are the "{ }" brackets used for and why not the usual "( )"?
Thanks again!
Carlos
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,252
Members
449,075
Latest member
staticfluids

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