You are right, I got carried away with my TODAY()s.
I should have said
=IF(E4="","",IF(E4<=TODAY()+21,E4+21,DATE(YEAR(E4) ,MONTH(E4)+6,DAY(E4))))
and
=IF(E4="","",IF(E4<=TODAY()+21,E4+90,DATE(YEAR(E4) +1,MONTH(E4),DAY(E4))))
but it still gives different answers than you predict, as according to my
math, 4th April is <= TODAY + 21 days, so it is just E4 + 21 and 90.
--
HTH
RP
(remove nothere from the email address if mailing direct)
"David" wrote in message
...
Bob Phillips wrote
F4:
=IF(E4="","",IF(E4<=TODAY()+21,TODAY()+21,DATE(YEA R(TODAY()),MONTH(TODA
Y())+ 6,DAY(TODAY()))))
G4:=IF(E4="","",IF(E4<=TODAY()+21,TODAY()+90,DATE( YEAR(TODAY())+1,MONTH
(TODAY()),DAY(TODAY()))))
Hmm... Guess I didn't explain my needs accurately.
Using your formulas with 4/4/05 in E4 I wound up with:
F4: 8/12/05
G4: 10/20/05
When what I wanted was:
F4: 10/4/05
G4: 4/4/06
On my own, I was able to at least get G4 to equal what I want with:
=IF(F4="","",IF(F4-E4<=21,DATE(YEAR(E4),MONTH(E4)+3,DAY(E4)),DATE(YEA R
(F4),MONTH(F4)+6,DAY(F4))))
But that was after manually entering 10/4/05 into F4
We got closer with 7/22/05 in E4:
Results:
F4: 8/12/05 as desired
G4: 10/20/05 when I wanted 10/22/05
As a matter of fact, no matter what the date in E4, results with your
formulas are ALWAYS F4:8/12/05 and G4:10/20/05
The more I think about a real life scenario, though, F4 will actually vary
and not depend on E4 after the initial 90-day period, so I'll be entering
its date manually after 90 days.
But the mystery remains why we were off by 2 days in the second example
above.
--
David
|