Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Calculating to add years - including leap year

I have a function that needs to add 3 years to a date field. I am currently
adding 1095 days (3 years x 365) to the base number, but if there is a leap
year in those three, I'm off by one day. How can I add three years and make
sure that the extra day is included if one year is a leap year?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Calculating to add years - including leap year

One possible way

=DATE(YEAR(F1)+3,MONTH(F1),DAY(F1))


where F1 holds the date you want to add 3 years to

Note that if the date in F1 is for instance 02/29/08 then my formula will
return
03/01/11


--
Regards,

Peo Sjoblom



"MareskiCP" wrote in message
...
I have a function that needs to add 3 years to a date field. I am
currently
adding 1095 days (3 years x 365) to the base number, but if there is a
leap
year in those three, I'm off by one day. How can I add three years and
make
sure that the extra day is included if one year is a leap year?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Calculating to add years - including leap year

Other users enter a date in a given cell, and I have another cell that should
calculate three years out from that date. I can't just add 1095 days... how
can I write the function to add 3 years to a different date field? I need to
get your formula below to recognize that the date for (F1) comes from another
cell.

"Peo Sjoblom" wrote:

One possible way

=DATE(YEAR(F1)+3,MONTH(F1),DAY(F1))


where F1 holds the date you want to add 3 years to

Note that if the date in F1 is for instance 02/29/08 then my formula will
return
03/01/11


--
Regards,

Peo Sjoblom



"MareskiCP" wrote in message
...
I have a function that needs to add 3 years to a date field. I am
currently
adding 1095 days (3 years x 365) to the base number, but if there is a
leap
year in those three, I'm off by one day. How can I add three years and
make
sure that the extra day is included if one year is a leap year?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Calculating to add years - including leap year

That's what it does

If you put a date in F1 (in my example) and format the cell with the formula
as a date you will get a date with 3 years added and it will take leap years
into consideration


--
Regards,

Peo Sjoblom



"MareskiCP" wrote in message
...
Other users enter a date in a given cell, and I have another cell that
should
calculate three years out from that date. I can't just add 1095 days...
how
can I write the function to add 3 years to a different date field? I need
to
get your formula below to recognize that the date for (F1) comes from
another
cell.

"Peo Sjoblom" wrote:

One possible way

=DATE(YEAR(F1)+3,MONTH(F1),DAY(F1))


where F1 holds the date you want to add 3 years to

Note that if the date in F1 is for instance 02/29/08 then my formula
will
return
03/01/11


--
Regards,

Peo Sjoblom



"MareskiCP" wrote in message
...
I have a function that needs to add 3 years to a date field. I am
currently
adding 1095 days (3 years x 365) to the base number, but if there is a
leap
year in those three, I'm off by one day. How can I add three years and
make
sure that the extra day is included if one year is a leap year?






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Calculating to add years - including leap year

Try this:
=EDATE(A1,12*3)

Required Analysis ToolPak Add-Ins


"MareskiCP" wrote:

I have a function that needs to add 3 years to a date field. I am currently
adding 1095 days (3 years x 365) to the base number, but if there is a leap
year in those three, I'm off by one day. How can I add three years and make
sure that the extra day is included if one year is a leap year?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does the Networkdays function allow for leap years FLYNNE Excel Worksheet Functions 1 May 2nd 07 06:34 PM
How does Excel allow for leap years? Neil Excel Worksheet Functions 2 May 12th 06 09:16 AM
Non Leap Years I want to show 28, leap years show 29 in an"IF" bob@toyota-lift Excel Worksheet Functions 3 January 20th 06 08:25 PM
Does "DATEDIF" function count leap years? malik641 Excel Worksheet Functions 1 August 10th 05 03:17 PM
DATEDIF and leap years Leyland New Users to Excel 2 July 21st 05 07:49 PM


All times are GMT +1. The time now is 02:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"