+ Reply to Thread
Results 1 to 21 of 21

Calculating time difference over midnight

  1. #1
    Registered User
    Join Date
    12-26-2021
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    17

    Calculating time difference over midnight

    Hi There,
    Happy New Year !
    Need some help please...I am struggling to compute the total time (In HH:MM) taken in excel with 2 sets of date where one is past days or midnight.
    Example one set of date/time is 12DEC23/23:00 and another set is 14Dec23/02:00.

    May I know what's the best and easy formula I can use to calculate the total time taken for these 2 dates ?

    Thank you so much in advance for your expertise advise.

    Regards/Robert

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculating time difference over midnight

    If the dates are formatted as dates, and 12DEC23/23:00 is in A1 and 14Dec23/02:00 is in A2, please try =A2-A1 and format the result cell: [hh]:mm
    If the dates are formatted in another way, please upload a sample workbook.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2506
    Posts
    13,791

    Re: Calculating time difference over midnight

    Hello Robert. Welcome to the forum.

    While waiting for you to respond to HansDouwe's request and with the understanding your data is text .... again with values in A1 and A2 try this in B1
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  4. #4
    Registered User
    Join Date
    12-26-2021
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Calculating time difference over midnight

    Good morning, Dave & Hans,
    Thank you for your prompt reply and attached is the sample workbook that was extracted from system that the date/time is a mess !
    So I am trying to compute the total time taken from issued that was reported till it was resolved.

    Attached sample workbook for your reference.

    Appreciate your expertise advise.
    Regards/Robert
    Attached Files Attached Files

  5. #5
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculating time difference over midnight

    Please try in D2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Format column D: [hh]:mm:ss

  6. #6
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Calculating time difference over midnight

    It seems that you have 4 negative results.
    Attached Files Attached Files
    Last edited by DJunqueira; 01-03-2024 at 10:54 PM.

  7. #7
    Registered User
    Join Date
    12-26-2021
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Calculating time difference over midnight

    Quote Originally Posted by HansDouwe View Post
    Please try in D2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Format column D: [hh]:mm:ss
    Hello Hans,
    I had tried the copy/paste the formula in D2 column and also formatted the column D as "hh:mm".. The outcome is most of the result in column D are shown as "#VALUE!"

  8. #8
    Registered User
    Join Date
    12-26-2021
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Calculating time difference over midnight

    Quote Originally Posted by DJunqueira View Post
    It seems that you have 4 negative results.
    These 4 results are expected due to human error where the "resolved time" is earlier than the "reported time". Please ignore this. Thank you !
    Regards/Robert

  9. #9
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculating time difference over midnight

    The outcome is most of the result in column D are shown as "#VALUE!"
    Please upload a sample workbook with the error.

  10. #10
    Registered User
    Join Date
    12-26-2021
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Calculating time difference over midnight

    Quote Originally Posted by HansDouwe View Post
    Please upload a sample workbook with the error.
    Here you go.. Thank you so much.
    Regards/Robert
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-04-2018
    Location
    Europe
    MS-Off Ver
    Office365
    Posts
    79

    Re: Calculating time difference over midnight

    Hi,

    Use TextToColumns for column B then column C and choose format of date as you want.
    Select data in column B then Data --> TextToColumns --> Next --> Next and here choose your format date (dmy or mdy or....)
    Idem for column C

    Some data are data in > data out.
    Attached Files Attached Files
    Last edited by Tommy90; 01-09-2024 at 05:18 AM.

  12. #12
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculating time difference over midnight

    The Value error is caused by local settings.
    The dates are written in format dd/mm/yyyy, but your Excel expects format mm/dd/yyyy.

    Please try this formula in D2 and copy it down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This should work for you.

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

    Re: Calculating time difference over midnight

    These 4 results are expected due to human error where the "resolved time" is earlier than the "reported time". Please ignore this. Thank you !
    If you correct these results then this should work
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  14. #14
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2019
    Posts
    4,542

    Re: Calculating time difference over midnight

    Delete delete

  15. #15
    Registered User
    Join Date
    12-26-2021
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Calculating time difference over midnight

    Quote Originally Posted by HansDouwe View Post
    The Value error is caused by local settings.
    The dates are written in format dd/mm/yyyy, but your Excel expects format mm/dd/yyyy.

    Please try this formula in D2 and copy it down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This should work for you.
    Dear HansDouwe,
    This formula worked like a charm !
    One more question... How do I get the result in MINS for all data in column D ? I used =SUM(D2:D1576) with format as "Number", but get error "#VALUE!".
    Appreciate your help on this matter ? Thank you so much !

    Regards/Robert
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    12-26-2021
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Calculating time difference over midnight

    Thank you for that !
    Regards/Robert

  17. #17
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculating time difference over midnight

    How do I get the result in MINS for all data in column D
    Please try and format cell as a number
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    or try and custom format cell as [m]
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by HansDouwe; 01-10-2024 at 04:08 AM.

  18. #18
    Registered User
    Join Date
    12-26-2021
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Calculating time difference over midnight

    Quote Originally Posted by HansDouwe View Post
    Please try and format cell as a number
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    or try and custom format cell as [m]
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you so much, great appreciated!
    Regards/Robert

  19. #19
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculating time difference over midnight

    You are Welcome!

    Thanks for the feedback. Glad to have helped. .

    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 each of those who offered help.

  20. #20
    Registered User
    Join Date
    12-26-2021
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Calculating time difference over midnight

    Thanks for sharing and indeed I am not aware of this feature. Nevertheless, I had did it this round ! Once again, Thank you so much for your help !

  21. #21
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Calculating time difference over midnight

    Thanks for the rep . Glad to have helped.

+ 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. Calculating time difference over midnight!
    By sygazelle in forum Excel General
    Replies: 14
    Last Post: 05-28-2022, 04:20 PM
  2. [SOLVED] Caluculating Time Difference After Midnight
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2019, 01:49 AM
  3. [SOLVED] Calculating time differences in 24 hour time when going past midnight
    By Thug in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-29-2018, 10:22 AM
  4. [SOLVED] Tiimelog - Time Difference Crossing Over or Past Midnight
    By mycon73 in forum Excel General
    Replies: 6
    Last Post: 10-20-2016, 06:41 AM
  5. [SOLVED] formula to calculate time difference crossing midnight
    By ditorejax in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-06-2014, 08:27 PM
  6. [SOLVED] Calculating difference in time after midnight
    By alan peele in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-16-2013, 02:01 AM
  7. Calculating time after midnight
    By ryangodammit in forum Excel General
    Replies: 5
    Last Post: 12-09-2008, 11:57 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