Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]() How do I obtain the days, hours, min and sec between two date/time stamps represented in an excel spreadsheet? For example: I have "4/6/2005 10:00:00 AM" in cell A1 and "4/4/2005 7:00:00 AM" in cell A2. How can I obtain the dd:hh:mm:ss between both date/time stamps in cell A3? A _________________ 1 4/6/2005 10:00:00 AM 2 4/4/2005 7:00:00 AM 3 ??Days, ??Hrs, ??Min, ??Sec -- lnapier ------------------------------------------------------------------------ lnapier's Profile: http://www.excelforum.com/member.php...o&userid=24729 View this thread: http://www.excelforum.com/showthread...hreadid=382956 |
#2
![]() |
|||
|
|||
![]()
One way:
=INT(A2-A1) & " Days, " & TEXT(MOD(A2-A1,1), "h"" Hrs, ""m"" Min, ""s"" Sec""") In article , lnapier wrote: How do I obtain the days, hours, min and sec between two date/time stamps represented in an excel spreadsheet? For example: I have "4/6/2005 10:00:00 AM" in cell A1 and "4/4/2005 7:00:00 AM" in cell A2. How can I obtain the dd:hh:mm:ss between both date/time stamps in cell A3? A _________________ 1 4/6/2005 10:00:00 AM 2 4/4/2005 7:00:00 AM 3 ??Days, ??Hrs, ??Min, ??Sec |
#3
![]() |
|||
|
|||
![]()
Another way:
in A3, =A1-A2 or maybe =abs(A1-A2) if A2 is not always earlier. Format A3 as custom with: d"Days," h"Hrs," m"Min," s"Sec" lnapier wrote: How do I obtain the days, hours, min and sec between two date/time stamps represented in an excel spreadsheet? For example: I have "4/6/2005 10:00:00 AM" in cell A1 and "4/4/2005 7:00:00 AM" in cell A2. How can I obtain the dd:hh:mm:ss between both date/time stamps in cell A3? A _________________ 1 4/6/2005 10:00:00 AM 2 4/4/2005 7:00:00 AM 3 ??Days, ??Hrs, ??Min, ??Sec |
#4
![]() |
|||
|
|||
![]()
Note that "d" is the format code for day of the month, so this will give
the wrong result if the user's date system setting is the 1904 system. Likewise it will be wrong if the elapsed time is more than 31 days. In article <mWqwe.1823172$6l.6237@pd7tw2no, LenB wrote: in A3, =A1-A2 or maybe =abs(A1-A2) if A2 is not always earlier. Format A3 as custom with: d"Days," h"Hrs," m"Min," s"Sec" |
#5
![]() |
|||
|
|||
![]() Thanks to JE McGimpsey for the below solution, which works great to determine the duration between the two dates. I was really impressed with the time it took for you to respond. Thanks a million. However I have some more questions if you don't mind. Solution: =INT(A2-A1) & " Days, " & TEXT(MOD(A2-A1,1), "h"" Hrs, ""m"" Min, ""s"" Sec""") Here's a new challenge! My next question is how can I have the calculation cull out weekends and holidays from the duration that the formula provides? If I have a duration that spans across a weekend and then a holiday between two dates, I don't want the duration result to reflect that time. Additionally, would it be possible to further constrain the result by culling out off-hours time between (1700-0600) daily? I only want to count time that has expired between (0600 - 1700) which is our standard work day. -- lnapier ------------------------------------------------------------------------ lnapier's Profile: http://www.excelforum.com/member.php...o&userid=24729 View this thread: http://www.excelforum.com/showthread...hreadid=382956 |
#6
![]() |
|||
|
|||
![]()
Ooops. My mistake. Thanks for pointing it out.
Len JE McGimpsey wrote: Note that "d" is the format code for day of the month, so this will give the wrong result if the user's date system setting is the 1904 system. Likewise it will be wrong if the elapsed time is more than 31 days. In article <mWqwe.1823172$6l.6237@pd7tw2no, LenB wrote: in A3, =A1-A2 or maybe =abs(A1-A2) if A2 is not always earlier. Format A3 as custom with: d"Days," h"Hrs," m"Min," s"Sec" |
#7
![]() |
|||
|
|||
![]() Hi If I have a loan that is rollover from 15 Dec 04 till 28 Mar 05. I need a formula to autoculate the accrued no of days for interest in Jan, Feb and Mar. ie Jan =31 days, Feb = 28 days and Mar = 28 days. Is it possible? thks for helping -- Jesline ------------------------------------------------------------------------ Jesline's Profile: http://www.excelforum.com/member.php...o&userid=24777 View this thread: http://www.excelforum.com/showthread...hreadid=382956 |
#8
![]() |
|||
|
|||
![]() Jesline, I'm still trying to figure out my issue. Please start your own discussion thread concerning your inquiry. Thanks. Larry -- lnapier ------------------------------------------------------------------------ lnapier's Profile: http://www.excelforum.com/member.php...o&userid=24729 View this thread: http://www.excelforum.com/showthread...hreadid=382956 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? | Excel Discussion (Misc queries) | |||
can you tell me the difference between excel 2000 and excel 2003 | Excel Discussion (Misc queries) | |||
Excel static current date/time problem | Excel Worksheet Functions | |||
Difference between Publish and Save As Web Page in Excel 2002 | Excel Discussion (Misc queries) | |||
Difference between ExcelXP and Excel 2003 | Excel Worksheet Functions |