Dates

F

frykid50

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?
 
K

Kevin B

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.
 
D

Dave Peterson

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?
 
P

Pete_UK

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
 
J

John C

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.
 
J

John

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
 
J

John

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

John said:
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
 
F

frykid50

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!
 
J

John C

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top