#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Dates

I have a date (1/31/08) and I need to add 25 years to it. I know the formula
to do this (=Date(YEAR(A4)+B4,MONTH(A4),DAY(A4)) where the answer is
12/10/2033. No problem. However, does this account for a leap year?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default Dates

Leap years are already incorporated into the serial calendar used by Excel,
so you don't need to account for them. It's a done deal.
--
Kevin Backmann


"frykid50" wrote:

I have a date (1/31/08) and I need to add 25 years to it. I know the formula
to do this (=Date(YEAR(A4)+B4,MONTH(A4),DAY(A4)) where the answer is
12/10/2033. No problem. However, does this account for a leap year?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Dates

Yep.

But if your starting date were Feb 29, 2008, then since there isn't a Feb 29,
2033, your suggested formula would return Mar 1, 2033.

Is that what you'd want returned?



frykid50 wrote:

I have a date (1/31/08) and I need to add 25 years to it. I know the formula
to do this (=Date(YEAR(A4)+B4,MONTH(A4),DAY(A4)) where the answer is
12/10/2033. No problem. However, does this account for a leap year?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Dates

Easy enough to try - put 29 Feb 2008 in A4 and 25 in B4 and your
formula will return 1st March 2033, as there is no 29th Feb that year.
So, the formula does account for leap years, but when you start with
Leap Day you will get 1st March of the year 25 years hence. If you
start with 28th Feb, you will still get 28th Feb but 25 years on.

I'm not sure how you get your answer though - what did you have in B4?

Hope this helps.

Pete

On Nov 12, 5:13*pm, frykid50
wrote:
I have a date (1/31/08) and I need to add 25 years to it. *I know the formula
to do this (=Date(YEAR(A4)+B4,MONTH(A4),DAY(A4)) where the answer is
12/10/2033. *No problem. *However, does this account for a leap year?


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,358
Default Dates

If you have the Analysis ToolPak add-in installed, you could shorten your
formula:
Assuming B4 has 25
=EDATE(A4,B4*12)

I am curious as to what is in B4, as if you are just adding 25 years to the
date in A4 (given as 1/31/2008), and B4 is 25 years, my excel comes up with
1/31/2033, not 12/10/2033. The advantage of the EDATE function also is it
does take into account leap years.
Your formula, with date of 2/29/2008 in A4, the result would be 3/1/2033,
the EDATE formula results in 2/28/2033. So it wholly depends on what your
desired response would be.

--
** John C **

"frykid50" wrote:

I have a date (1/31/08) and I need to add 25 years to it. I know the formula
to do this (=Date(YEAR(A4)+B4,MONTH(A4),DAY(A4)) where the answer is
12/10/2033. No problem. However, does this account for a leap year?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 694
Default Dates

To answer your question "Yes"
But I don't know where you're getting that answer ( 12/10/2033 ) 35 years
will bring you to Jan/31/2033 including 7 leap years
Regards
John

"frykid50" wrote in message
...
I have a date (1/31/08) and I need to add 25 years to it. I know the
formula
to do this (=Date(YEAR(A4)+B4,MONTH(A4),DAY(A4)) where the answer is
12/10/2033. No problem. However, does this account for a leap year?


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 694
Default Dates

Sorry 25 years will bring you to Jan/31/2033

"John" wrote in message
...
To answer your question "Yes"
But I don't know where you're getting that answer ( 12/10/2033 ) 35 years
will bring you to Jan/31/2033 including 7 leap years
Regards
John

"frykid50" wrote in message
...
I have a date (1/31/08) and I need to add 25 years to it. I know the
formula
to do this (=Date(YEAR(A4)+B4,MONTH(A4),DAY(A4)) where the answer is
12/10/2033. No problem. However, does this account for a leap year?



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Dates

thanks for all the replies...they were all helpful.

oh and i put the wrong date in (12/10/20033). that's what happens when
trying to do 2 things at once!

"John" wrote:

Sorry 25 years will bring you to Jan/31/2033

"John" wrote in message
...
To answer your question "Yes"
But I don't know where you're getting that answer ( 12/10/2033 ) 35 years
will bring you to Jan/31/2033 including 7 leap years
Regards
John

"frykid50" wrote in message
...
I have a date (1/31/08) and I need to add 25 years to it. I know the
formula
to do this (=Date(YEAR(A4)+B4,MONTH(A4),DAY(A4)) where the answer is
12/10/2033. No problem. However, does this account for a leap year?




  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,358
Default Dates

Thanks for the feedback. Be sure to indicate by checking the YES box below
that your question has been answered :)
--
** John C **

"frykid50" wrote:

thanks for all the replies...they were all helpful.

oh and i put the wrong date in (12/10/20033). that's what happens when
trying to do 2 things at once!

"John" wrote:

Sorry 25 years will bring you to Jan/31/2033

"John" wrote in message
...
To answer your question "Yes"
But I don't know where you're getting that answer ( 12/10/2033 ) 35 years
will bring you to Jan/31/2033 including 7 leap years
Regards
John

"frykid50" wrote in message
...
I have a date (1/31/08) and I need to add 25 years to it. I know the
formula
to do this (=Date(YEAR(A4)+B4,MONTH(A4),DAY(A4)) where the answer is
12/10/2033. No problem. However, does this account for 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
Stop dates from showing as numbers - when formated as dates JR Excel Discussion (Misc queries) 1 October 29th 08 04:38 PM
compare 2 tables of dates to find the preceding dates Babi Excel Worksheet Functions 3 October 28th 08 05:52 AM
how do I sort a column of random dates into Consecutive dates Rob Gibson Excel Worksheet Functions 2 June 12th 07 05:10 AM
Identifying unique dates within a range of cells containing dates cdavidson Excel Discussion (Misc queries) 0 October 12th 06 08:19 PM
Charting data against dates where dates are not at fixed intervals PK Charts and Charting in Excel 4 June 16th 05 05:08 AM


All times are GMT +1. The time now is 07:47 PM.

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

About Us

"It's about Microsoft Excel"