View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom[_3_] Peo Sjoblom[_3_] is offline
external usenet poster
 
Posts: 136
Default years-months-days-hours

I can see the 8 years but I can't see 11 months nor can I see 24 days?

I get 8 years, 2 months and 4 days?


With the earlier date in A1 and the later in A2


=DATEDIF(A1,A2,"Y")


to get the years


=DATEDIF(A1,A2,"YM")

to get the months after the years have been removed


=DATEDIF(A1,A2,"MD")


to get the days after the years and months have been removed




To get the hours

=HOUR(MOD(A2-A1,1))


I let you figure out the rest yourself

--


Regards,


Peo Sjoblom


"Raz" wrote in message
...
can anyone tell me how to do this, might be very simple. thanks in advance

i have two dates/time in this format mm/dd/yyyy hh:mm:ss
17/10/2001 12:35:20
21/12/2009 09:40:00

on another cell I would like the difference between these two dates in
this
format.

8 years, 11 months, 24 days, 00 hours, 20 min, 23 seconds.

or each in a different cell like these:
8 years
11 months
24 days
00 hours
20 min
23 seconds