Date formula :/

1. Date formula :/

I have luckily been able to put together most of the help I need from other threads and postings, but I am still a little short of my answer. Should be an easy one for an eperienced person though.

Problem: I have =Today() in A2 and I have an expiration date in C4. Now my formula cell is G2 and it has =IF((C4-A2)<30,1,IF((C4-A2)<14,2,0)).
The issue with this formula is that when there are less than 30 days before expiration it shows a 1 even if it is under 14 days away. I need it to show that 2 if it's under 14 but can't get it. Only a 1 or 0. Thanks for anyone who can help!

2. Re: Date formula :/

Change the conditions' order =IF((C4-A2)<14,2,IF((C4-A2)<30,1,0)).

3. Re: Date formula :/

I'll give you an explanation for the IF() function and I'm sure you'll figure it out

The function looks at each condition in order. As soon as it finds a condition that is true it stops and provides the result you want for that condition.

Your first condition is true before your second condition gets looked at.

4. Re: Date formula :/

this formula would also give you the required result

=(C4-A2<30)+(C4-A2<14)

5. Re: Date formula :/

That got it, I used daddylonglegs's formula cuz I'm a sucker for simplicity but now I understand the function thanks to you others. I really appreciate it!

There are currently 1 users browsing this thread. (0 members and 1 guests)