+ Reply to Thread
Results 1 to 8 of 8

Calculate difference in time for period over 24hrs - result in hours:min

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

    Calculate difference in time for period over 24hrs - result in hours:min

    Hi,

    I'm trying to obtain a formula that will calculate the difference in time between two dates showing the result in hours and minutes.

    I pulled this from another thread which gives the result in days:hours:mins

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

    what changes need to be made to show the result in hours:mins?

  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 in time for period over 24hrs - result in hours:min

    Format cell as [h]:mm

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

    Re: Calculate difference in time for period over 24hrs - result in hours:min

    Thx for the reply zbor however simply changing the format of the cell does not give the required result.

    If the total difference is 1 day 14hrs and 40 mins chaning the format to [h]:mm has no effect when using to calculate the difference.

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

    can anyone else help?
    Attached Files Attached Files

  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 in time for period over 24hrs - result in hours:min

    Here, try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,284

    Re: Calculate difference in time for period over 24hrs - result in hours:min

    C2-A2
    format cell as: [u]" hrs "mm" mins "ss" secs"
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

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

    Re: Calculate difference in time for period over 24hrs - result in hours:min

    Quote Originally Posted by zbor View Post
    Here, try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    That's the ticket - Thx zbor

  7. #7
    Registered User
    Join Date
    04-14-2013
    Location
    henderson, tennessee
    MS-Off Ver
    365
    Posts
    42

    Re: Calculate difference in time for period over 24hrs - result in hours:min

    I tried editing your original formula from:
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and got it to output minus seconds. Maybe another option in addition to zbor's.

  8. #8
    Registered User
    Join Date
    04-14-2013
    Location
    henderson, tennessee
    MS-Off Ver
    365
    Posts
    42

    Re: Calculate difference in time for period over 24hrs - result in hours:min

    Guess I should have re-read your post. You wanted to output as only hours and minutes.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Formula Needed - Calculate total hours that fall between a specific time period.
    By JennyGP in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 04-19-2020, 02:44 AM
  2. Calculate time difference after 24hrs
    By PRodgers in forum Excel General
    Replies: 4
    Last Post: 07-16-2009, 08:24 AM
  3. [SOLVED] calculate difference in time spanning a day, during office hours o
    By frozenfusion in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-29-2005, 04:05 AM
  4. [SOLVED] Calculate difference in time spanning a day, during office hours o
    By frozenfusion in forum Excel General
    Replies: 1
    Last Post: 08-26-2005, 06:05 AM
  5. [SOLVED] calculate difference in time to hours
    By Chris in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-18-2005, 03:06 PM

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