+ Reply to Thread
Results 1 to 10 of 10

Calculation of Time duration in hours from 24hours input data

  1. #1
    Registered User
    Join Date
    03-29-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    7

    Calculation of Time duration in hours from 24hours input data

    Hello Everyone. I am facing an uphill task in to creating formula to calculate duration of time taken in hours using 24hours input. Can someone show me how to do so? Thanks for your time
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,017

    Re: Calculation of Time duration in hours from 24hours input data

    Enter time as TIME format not TEXT

    03:00

    16:45

    then time difference

    =MOD(C4-B4,1)

    For total format cell as [h]:mm
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-29-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    7
    Quote Originally Posted by JohnTopley View Post
    Enter time as TIME format not TEXT

    03:00

    16:45

    then time difference

    =MOD(C4-B4,1)

    For total format cell as [h]:mm
    Hi JohnTopley

    You had shown a great way to get the duration. Would it possible to tweak the formula abit to compute the duration in hours only? Example: 1hr 30min to 1.5hrs? Thanks

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Calculation of Time duration in hours from 24hours input data

    Use this formula:

    =MOD(C4-B4,1)*24

    Format as General or Number
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    510

    Re: Calculation of Time duration in hours from 24hours input data

    to keep the same format try

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-29-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    7

    Re: Calculation of Time duration in hours from 24hours input data

    Quote Originally Posted by Toonies View Post
    to keep the same format try

    Please Login or Register  to view this content.
    Hi Toonies

    Your formula works terrific for B4 & C4. It does not work from B5 & C5 onward as they exceed into the following days.

    Is it possible to calculate till next day up to 24hrs?

    Eg: Time start: 2045hrs Time End: 1930hrs Duration: 22.75hrs

    If the Time end is larger than Time start, it will consider completion on that day and calculate directly?

    Eg: Time Start: 2045hrs Time End: 2200hrs Duration: 1.25hrs
    Last edited by maxonline; 04-02-2016 at 10:33 AM. Reason: Elaborate details

  7. #7
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Calculation of Time duration in hours from 24hours input data

    Hello
    If you're not going to use John's suggestion of using time formats, and using text, then you could amend Tony's idea with the TIMEVALUE function, for example:

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


    DBY
    Last edited by DBY; 04-02-2016 at 11:10 AM.

  8. #8
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    510

    Re: Calculation of Time duration in hours from 24hours input data

    The Formula does work

    If you check your Start and End Times in

    C5 You have input as '330 instead of 330 Remove the ' from infront of the Time

    Do the same for B6, C6, C7

    You have for some reason put a ' in front of your Time

  9. #9
    Registered User
    Join Date
    03-29-2016
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    7

    Re: Calculation of Time duration in hours from 24hours input data

    Quote Originally Posted by DBY View Post
    Hello
    If you're not going to use John's suggestion of using time formats, and using text, then you could amend Tony's idea with the TIMEVALUE function, for example:

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


    DBY
    Hi DBY

    Your solution is an exact match of what i seek. Thanks once again!!

  10. #10
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Calculation of Time duration in hours from 24hours input data

    Glad we could help.

+ 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. Replies: 2
    Last Post: 07-14-2015, 02:12 PM
  2. Problem with calculation in a time duration formula
    By hal87 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-21-2015, 09:36 PM
  3. [SOLVED] need help with duration (cumulative time) calculation
    By hgeorges in forum Excel General
    Replies: 4
    Last Post: 07-29-2014, 04:01 PM
  4. Calculate finish time given start time, working hours and job duration
    By swanseaexcel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-23-2012, 03:00 PM
  5. [SOLVED] Calculate Hours Between Two Dates and Times in Excel Exceeding 24Hours
    By Hikari in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-08-2012, 01:20 AM
  6. [SOLVED] Sumproduct with Time Duration calculation
    By gav0101 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-05-2012, 06:34 PM
  7. Duration of time for two dates in days, hours and minutes
    By sgrimm in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-18-2006, 09:39 AM

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