+ Reply to Thread
Results 1 to 4 of 4

Add Hours that Cross Midnight

  1. #1
    Registered User
    Join Date
    03-06-2005
    Location
    Pottsboro, TX
    MS-Off Ver
    MS 365 - Version 2208
    Posts
    98

    Add Hours that Cross Midnight

    Good day all,
    Any help is greatly appreciated!!

    I have employees that will manually add their start and end time in separate cells. These hours could cross midnight. In another cell these hours are calculated to display the duration between these times.

    Is there a way to do this calculation when it crosses midnight without a date (the date is in another cell)?

    I have attached a snippet of my worksheet to view.

    I am using MS365.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2411 (Windows 11 23H2 64-bit)
    Posts
    87,931

    Re: Add Hours that Cross Midnight

    Try this:

    =MROUND((C5+(1*(C5<B5))-B5),1/96)

    where B5 is the start time and C5 is the end time.
    Attached Files Attached Files
    Last edited by AliGW; 07-25-2023 at 03:50 AM. Reason: Workbook added.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2411 (Windows 11 23H2 64-bit)
    Posts
    87,931

    Re: Add Hours that Cross Midnight

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2021
    Posts
    6,137

    Re: Add Hours that Cross Midnight

    Or try this:

    =MROUND(MOD(C5-B5,1),1/96)

+ 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] Calculate how many hours between two times are before midnight and after midnight
    By annazet in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-05-2019, 09:47 AM
  2. Elapsed times that cross midnight.
    By FayY in forum Excel General
    Replies: 4
    Last Post: 09-21-2019, 01:24 PM
  3. Replies: 5
    Last Post: 04-13-2017, 11:05 AM
  4. [SOLVED] Looking for MAX formula when times span or cross midnight
    By Rex411 in forum Excel General
    Replies: 6
    Last Post: 02-16-2016, 08:22 PM
  5. Replies: 1
    Last Post: 06-03-2014, 06:28 PM
  6. getting the difference bewtween two times accounting for midnight cross over
    By superchew in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-12-2013, 11:30 PM
  7. Replies: 1
    Last Post: 06-30-2010, 07:48 PM

Tags for this Thread

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