Calculate diiference between 2 dates

J

Jester

I have 2 dates and I want to calculate the difference expressed as the
following string:

(eg) 9 Years 3 months and 13 days

Can anyone help?

Many Thanks

John - Sydney Aust
 
M

Mike

=DATEDIF(A1,A2,"y") & " years, " & DATEDIF(A1,A2,"ym") & " months, " &
DATEDIF(A1,A2,"md") & " days"

should do the trick with the dates in A1 & A2

Mike
 
N

Niek Otten

Hi John,

=DATEDIF(A1,A2,"y") & " Years " & DATEDIF(A1,A2,"ym") & " months and " & DATEDIF(A1,A2,"md") & " days"

For info about the DATEDIF function, look here:

http://www.cpearson.com/excel/datedif.htm
--
Kind regards,

Niek Otten
Microsoft MVP - Excel

|I have 2 dates and I want to calculate the difference expressed as the
| following string:
|
| (eg) 9 Years 3 months and 13 days
|
| Can anyone help?
|
| Many Thanks
|
| John - Sydney Aust
|
|
 
J

Jester

Thankyou very much!!!
Mike said:
=DATEDIF(A1,A2,"y") & " years, " & DATEDIF(A1,A2,"ym") & " months, " &
DATEDIF(A1,A2,"md") & " days"

should do the trick with the dates in A1 & A2

Mike
 
B

Bill Ridgeway

I've run a quick check on this formula. It doesn't seem to include
additional leap year days.

Regards.

Bill Ridgeway
Computer Solutions
 
B

Bill Ridgeway

On reflection I suppose it wouldn't - and rightfully so. The possible
danger in calculating using year and month is that they are not a standard
length. Days on the other hand is a much more precise measure.

There is one perennial trap when calculating the period between two dates.
The answer lies in whether or not you are counting gross or net days. In a
situation of, say, the payment of a pension due in a year, the number of
days in payment is 365 (366). In a situation of, the number of days
available to do something, the number of days is 364 (365).

Regards.

Bill Ridgeway
Computer Solutions
 
J

Jester

Chhers Bill , in my case I am more than happy with what the formula does.
It meets my needs precisely


John
 
Top