+ Reply to Thread
Results 1 to 6 of 6

Can't get the difference in time correct

  1. #1
    Forum Contributor
    Join Date
    07-29-2005
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    253

    Question Can't get the difference in time correct

    Hi,

    I can't seems to get the difference in time correct.

    A1 = 18:33
    A2 = 00:56

    A3 = AVERAGE(A1:A2) = 22:44

    All cells are formated as hh:mm
    I got the difference to be 9hrs 44mins but the formula shows 22:44. What did I do wrong?

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

    Re: Can't get the difference in time correct

    Are you sure the values in A1 & A2 are < 24 hours ?

    If you apply a format to A1 & A2 of [hh]:mm what is displayed ?

  3. #3
    Forum Contributor
    Join Date
    07-29-2005
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    253

    Re: Can't get the difference in time correct

    Quote Originally Posted by DonkeyOte View Post
    Are you sure the values in A1 & A2 are < 24 hours ?

    If you apply a format to A1 & A2 of [hh]:mm what is displayed ?
    Wow A1 = 738:33 and A2 = 24:56. What did [hh] do?

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

    Re: Can't get the difference in time correct

    [ ] displays in cumulative terms

    (eg [mm]:ss would show the total in cumulative minutes and seconds, [ss] just seconds etc...)

    It follows you should apply the same format to your AVERAGE calculation result...

  5. #5
    Forum Contributor
    Join Date
    07-29-2005
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    253

    Re: Can't get the difference in time correct

    Quote Originally Posted by DonkeyOte View Post
    [ ] displays in cumulative terms

    (eg [mm]:ss would show the total in cumulative minutes and seconds, [ss] just seconds etc...)

    It follows you should apply the same format to your AVERAGE calculation result...
    Do you mean cumulative in hh like it accumulates the hour by days? Example day 1 = 24hrs, day 2 = 16hrs. Thus total hours between the 2 days = 40hrs?

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

    Re: Can't get the difference in time correct

    Time in XL is Decimal - eg 6am = 0.25, noon = 0.5, 6pm = 0.75... it follows that 24 hours = 1.

    Consider:

    A1: 18:00
    A2: 12:00
    A3: =SUM(A1:A2)

    In Time terms we know the sum is 30 hours so in terms of underlying numerics we know this equates to 1.25 (1 and 1/4 days) - we can see this if we format A3 as General.

    If we format A3 as Time XL will display the Time portion of that value - and we know that is the Decimal part, ie 0.25 so we will see 06:00 (0.25)

    If we apply a Custom Format of [hh]:mm to A3 we are telling XL to show us the entire value in terms of Time and not just the decimal portion ... as a result we will get 30:00 (1.25)

    If we apply a format of [mm]:ss to A3 we are telling XL to do the same but now show us the entire value in terms of minutes (and seconds remainder) - eg 1800:00 (1800 minutes being 1.25 * 24 * 60)


    On an aside please do not quote prior posts in their entirety - either use Post Reply button or quote only those parts necessary to maintain a logical flow to the thread

+ 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