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

Carlos5

New Member
Joined
Jan 14, 2015
Messages
49
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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Phuoc

Well-known Member
Joined
Apr 29, 2016
Messages
694
Office Version
  1. 2016
Try this:

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

Carlos5

New Member
Joined
Jan 14, 2015
Messages
49
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
 

Forum statistics

Threads
1,176,685
Messages
5,904,437
Members
435,092
Latest member
armywalrus2

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
Top