+ Reply to Thread
Results 1 to 4 of 4

Calculate Hours Between Two Dates and Times in Excel Exceeding 24Hours

  1. #1
    Registered User
    Join Date
    10-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2019
    Posts
    74

    Calculate Hours Between Two Dates and Times in Excel Exceeding 24Hours

    Hi Guys

    I need a formula to calculate hours between two times & date. Please refer to the attached sample file that I have created to have better view on my question. Thanks.

    From my research on the net, I found few formula that might helped. However, those are formula for the data not exceeding 24 hours as per below.

    Formula A - Remarks - It is working. However, those exceeding 24 hours, the data will be display incorrectly. e.g. C10.
    Hours =TEXT(B2-A2,"h:mm")

    Formula B - Remarks - Working but it can't display minutes & those exceeding 24 hours will be incorrect. e.g. D2.
    Hours =HOUR(B2-A2)

    Formula C - Remarks - I tried to separate date & time to use this formula, however, the outcome is incorrect.
    Hours = ((End_Date+End_Time)-(Start_Date+Start_Time))*24
    Attached Files Attached Files
    Last edited by Hikari; 10-07-2012 at 11:53 PM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Calculate Hours Between Two Dates and Times in Excel Exceeding 24Hours

    hi Hikari, welcome to the forum. try:
    =TEXT(B2-A2,"[h]:mm")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    10-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2019
    Posts
    74

    Re: Calculate Hours Between Two Dates and Times in Excel Exceeding 24Hours

    Quote Originally Posted by benishiryo View Post
    hi Hikari, welcome to the forum. try:
    =TEXT(B2-A2,"[h]:mm")
    It's working fine! I never thought it could be easy like this! Gosh, I love Excel~ Thanks! :D

    I have clicked on * to rate, not sure if I'm doing it correctly? :P

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Calculate Hours Between Two Dates and Times in Excel Exceeding 24Hours

    you're welcome~ Excel is great indeed.

    thanks for the rep. you have done it right, including marking the thread as "Solved"

+ Reply to 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