+ Reply to Thread
Results 1 to 4 of 4

Time formatting issue

  1. #1
    Forum Contributor
    Join Date
    06-18-2008
    Posts
    123

    Time formatting issue

    Hi guys.

    I'm really struggling with this, even though it sounds simple!

    I'm working on a flexitime sheet for my department (I've attached a sample sheet). Each month the remaining hours, if any, roll over to the next month, and it also adds on two hours for that month. It all works fine except when I try and put it into hours/minutes format.

    Any ideas or help would be appreciated.

    Thanks all,

    Tony
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Time formatting issue

    Time in XL is decimal - ie 12 hours = 0.5, as far as XL is concerned 2 equates to 2 days hence formatting as time will display 00:00 (2 days and 0 time remainder) or if you used [hh]:mm it would read as 48:00 (2 * 24 hours)

    You also have added problem that by default XL can't display actual time values if they are negative ... unless a) running 1904 date sytem (not advised) b) all values are negative ... and so in truth you may in fact be better off continuing to work in your present format.

  3. #3
    Forum Contributor
    Join Date
    04-03-2007
    Location
    Auckland, New Zealand
    MS-Off Ver
    2007
    Posts
    137

    Re: Time formatting issue

    DonkeyOte's right.
    As far as XL is concerned Time only moves foward.

    If you're looking to simply display the time (in adjacent cells for instance) you could use the following.

    Please Login or Register  to view this content.
    Where B3 is one of the values you want to display in time format.
    The result will be text, and unusable in formulae.

    Please note: the formula above was adapted from a post by JBeaucaire on the same topics - if you've found this useful credit goes to the above.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Time formatting issue

    The formula could be IF less in truth

    =REPT("-",B3<0)&TEXT(ABS(B3/24),"H:MM")

    If you were prepared to accept it you could apply a close-ish custom format of 00.00 to the source values such that 2 would display as 02.00 etc (remainder would be in format of 0.5 for 30 mins however)
    Last edited by DonkeyOte; 06-16-2009 at 06:49 AM. Reason: clarification of non-whole hours

+ 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