+ Reply to Thread
Results 1 to 7 of 7

formatting a cell as time h:mm

  1. #1
    Registered User
    Join Date
    02-14-2012
    Location
    South Bend, IN
    MS-Off Ver
    Excel 2010
    Posts
    5

    formatting a cell as time h:mm

    Solved! How do you keep time over 24 hours in the format h:mm? It keeps changing it to a day and time if over 24 hours. I'm trying to track total hours worked in a week.
    Last edited by readingmommy; 02-15-2012 at 10:22 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: formatting a cell as time h:mm

    Hi,

    You can use a custom format of [h]:mm
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,079

    Re: formatting a cell as time h:mm

    Does this help?

    http://www.ozgrid.com/Excel/times-past-24.htm
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    02-14-2012
    Location
    South Bend, IN
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: formatting a cell as time h:mm

    Ok got it - now, if I want to enter a formula that will only pull the overtime hours from that total, how would I go about that? I've tried this set up and keep getting an error in my formula. Example: cell a4 contains the total time worked in the week (44:34). I typed this formula in cell b4 : =IF(a4>40:00, a4-40:00, 0). I want cell b4 to only show the 4:34 of overtime. Is this possible?

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,079

    Re: formatting a cell as time h:mm

    =IF(a4>TIMEVALUE("40:00:00"), a4-TIMEVALUE("40:00:00"), 0)

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,702

    Re: formatting a cell as time h:mm

    40 hours in Excel is equivalent to 40/24 so you can use

    =IF(A4>40/24,A4-40/24,0)

    or simpler.....

    =MAX(0,A4-40/24)
    Audere est facere

  7. #7
    Registered User
    Join Date
    02-14-2012
    Location
    South Bend, IN
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: formatting a cell as time h:mm

    Thank you! That worked! My boss said it couldn't be done, but I knew I was on the right track, just had to tweak it. I'm doing a little hurrah dance in your honor! Thanks for everyone's help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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