View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Subtracting 1 year from todays date

Hi again,

I was posting my reply while Stephi was already giving you a far better
answer so ignore mine. Too complicated.

Regards,

OssieMac


"OssieMac" wrote:

Hi Alan,

This is one way. ohters might be able to provide some other options.

=DAY(date) returns the day of the month
=MONTH(date) returns the month of the year as a number
=YEAR(date) returns the year as a number

=DAY("28/9/07") returns 28

=MONTH("28/9/07") returns 9

=YEAR("28/9/07") returns 2007

=YEAR("28/9/07")+1 returns 2008

Put them all to gether as follows:-

=VALUE(TEXT(DAY("28/9/07")&"-"&MONTH("28/9/07")&"-"&YEAR("28/9/07")+1,"d/mm/yy"))
Note above is actually one line. It returns 28/9/08. You can then format the
cell to display in any date format you like.

You can use a cell reference in lieu of the dates in double quotes.

Regards,

OssieMac



"Alan B" wrote:

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