Subtracting 1 year from todays date
With
A1: (a date eg 29-Feb-2004)
B1: (num of months to increment/decrement that date....eg -12)
Many formulas mis-handle 29-FEB in a leap year.....returning 01-MAR for the
date that is 12 months before or after that date.
These formulas return correct values:
If you have the Analysis ToolPak add-in installed:
C1: =EDATE(A1,B1)
Alternatively, this formula does not use the ATP:
=MIN(DATE(YEAR(A1),MONTH(A1)+(B1+{0,1}),DAY(A1)*{1 ,0}))
In my example, both formulas return: 28-Feb-2003
Does that help?
--------------------------
Regards,
Ron (XL2003, Win XP)
Microsoft MVP (Excel)
"Alan B" wrote in message
...
Does anyone know how to subtract from or add to the year in a given date
e.g
if today's date is 28 Sep 07 I would like to be able to add 1 and subtract
1
to the year only giving 28 Sep 06 and 28 Sep 08. If I do minus 365 it
will
work, but not on leap year dates.
Thanks
Alan
|