Closed Thread
Results 1 to 10 of 10

calculate difference between two dates and times in "days, hrs, mins, secs"

  1. #1
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Unhappy calculate difference between two dates and times in "days, hrs, mins, secs"

    Let say I have two cell with date and time together.

    Start date and time- A1: "01 Feb 2001 03:35:33"
    End date and time-B1:"05May 2001 04:28:21"

    What should I do to calculate the difference between with the result "days","hrs","mins" and "secs"?
    Last edited by mankit87; 10-24-2011 at 09:16 AM. Reason: Problem Solved, thank to all

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: calculate difference between two dates and times in "days, hrs, mins, secs"

    If those are dates write: =A2-A1 and format cell as: d" days "h" hrs "m" mins "s" secs"

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: calculate difference between two dates and times in "days, hrs, mins, secs"

    Fomatting using "d" for days doesn't work for periods over 31 days (because "d" shows day of month rather than elapsed days), so that format won't work for the example given beacuse days will show as 2 rather than 93

    Assuming A1 and B1 are valid date/times then try this formula in C1

    =INT(B1-A1)&" days "&TEXT(B1-A1,"h"" hrs ""m"" mins ""s""secs""")
    Audere est facere

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: calculate difference between two dates and times in "days, hrs, mins, secs"

    Thank for improvement and explanation

  5. #5
    Registered User
    Join Date
    10-08-2011
    Location
    malaysia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Wink Re: calculate difference between two dates and times in "days, hrs, mins, secs"

    wau!! million of thank to daddylonglegs. Not forget zbor too! thank for helping.

  6. #6
    Registered User
    Join Date
    09-03-2013
    Location
    England
    MS-Off Ver
    Office Pro Plus 2021
    Posts
    17

    Re: calculate difference between two dates and times in "days, hrs, mins, secs"

    Hi,

    Could you help me with the formula which displays the output in just hours and minutes?

  7. #7
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: calculate difference between two dates and times in "days, hrs, mins, secs"

    Hi meatychi

    Welcome to the forum..
    Please read Forum Rules,
    Although its appreciable that you have picked approx similar topic to post.. but hijacking other post is against forum's rule..
    Please start a New Thread.. and you may got better response..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  8. #8
    Registered User
    Join Date
    08-08-2013
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: calculate difference between two dates and times in "days, hrs, mins, secs"

    Please help to count days
    Start date End Date Total
    8/16/2013 8/31/2013 15

    But as you can see, the date I count by myself is 16 days, not 15 as the result.
    Pls help urgently.

    Many thanks

  9. #9
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: calculate difference between two dates and times in "days, hrs, mins, secs"

    Please read Forum Rules,
    Although its appreciable that you have picked approx similar topic to post.. but hijacking other post is against forum's rule..
    Please start a New Thread.. and you may got better response..

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: calculate difference between two dates and times in "days, hrs, mins, secs"

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1