ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Dates (https://www.excelbanter.com/excel-discussion-misc-queries/210027-dates.html)

frykid50

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?

Kevin B

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?


Dave Peterson

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

Pete_UK

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?



John C[_2_]

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?


John[_22_]

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?



John[_22_]

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?




frykid50

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?





John C[_2_]

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?





All times are GMT +1. The time now is 08:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com