LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
KC KC is offline
external usenet poster
 
Posts: 94
Default Difference between dates, but a bit more complicated

Leyla,

A1=Date1
B1=Date2
C1=B1-A1

and set C1 format as Number (so you should get decimal value in days)
once you have that
Seconds =$C$1*24*60*60
Minutes =$C$1*24*60-MOD($C$1*24*60,1)
Hours =$C$1*24-MOD($C$1*24,1)
Days =$C$1-MOD($C$1,1)
Months =$C$1/30-MOD($C$1/30,1)

Months and Days
=CONCATENATE($C$1/30-MOD($C$1/30,1)," Month
",($C$1-MOD($C$1,1)-(MOD($C$1/30,1)*30))-MOD(($C$1-MOD($C$1,1)-(MOD($C$1/30,1)*30)),1)," Days")

I'm sure there should be simpler formula, but it does not strike my mind now.

hope this helps?

regards,
-kc
*Click YES if this helps.
"Leyla" wrote:

Hi I have cells with dates and times together and I am trying to take the
difference of two dates. I have found out how to get the result in
days:hours:minutes. However, I would like to get the results with the month
as weel (months:days:hours:minutes). However, my main problem seems to be
that if there is less than a month, the default is zero. Adding days and
months was a solution to my orginal problem of not being able to change hours
to go past 24. Help with either issue would be appreciated. I have Excel
2002.

Thank you.

 
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
difference of 2 dates sierrabunny Excel Worksheet Functions 1 May 10th 09 09:08 AM
Difference between dates Khurum Excel Worksheet Functions 12 August 13th 08 12:53 AM
difference between two dates Arun Excel Discussion (Misc queries) 3 June 25th 08 10:49 AM
Difference of two dates sajan chauhan Excel Discussion (Misc queries) 3 June 5th 07 04:47 AM
difference between dates RGB Excel Discussion (Misc queries) 2 July 21st 06 12:42 PM


All times are GMT +1. The time now is 03:59 PM.

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

About Us

"It's about Microsoft Excel"