# Excel, calculating expiry dates & 3 answers/actions



## j-lo (Feb 28, 2008)

I have been unsuccessful in finding a formula that can track the status of an expiry date (within relation to the current date) and return one of the following 3 possible status results/messages:
1) "Expiring within next 30 days" (or maybe "Expiring in X days", where the "X" keeps counting down the days)
2) "OK"
3) "Expired"
Using an IF formula, I have been able to make the formula work returning 2 of my 3 responses, but have been unable to successfully add/return the 3rd status option.
Any help would be greatly appreciated!!


----------



## Glaswegian (Sep 16, 2005)

Hi and welcome to TSF.

Let's see if I've understood

*=IF(B2=NOW(),"OK",IF(B2<NOW(),"Expired",IF(B2<NOW()+30,"Expiring within next 30 days","")))*


----------



## j-lo (Feb 28, 2008)

Hi Glaswegian,
Thanks for the welcome, and the formula. I totally forgot about the "Now()" function and was trying to do it as a formula, so thanks for the reminder of a simpler formula.
FYI - the formula you provided was only giving me the "Expired" and "Expiring within next 30 days" responses so I tinkered with it and changed the "B2=NOW()" to "B2=NOW()>31" and am finally getting all three responses. It is working like a charm - THANKS!


----------



## Glaswegian (Sep 16, 2005)

Ah - gotcha - sorry about that. I used to be able to count...:grin:

Glad you got it sorted.


----------

