Results 1 to 13 of 13

Making Time roll over after 24 hours

Threaded View

  1. #1
    Registered User
    Join Date
    11-25-2009
    Location
    Illinois
    MS-Off Ver
    Excel 2007
    Posts
    8

    Making Time roll over after 24 hours

    I'm creating a calculator to determine the distance & travel time on a xy grid for a game. I'll share what I have so far to display the big picture. Here’s what I’ve accomplished so far:

    #1) Cells A1 & B1 are dynamic, they are frequently changed so distance and time may be displayed. Cells A2 & B2 do not change.

    #2) I use the following formula to determine the distance between cells, displayed in C2: =SQRT((A2-$A$1)^2+(B2-$B$1)^2)

    #3) Next I multiply C2 by a number so that distance is measured correctly per unit type for this game. (I hide this column). Therefore, cell D3 has the following formula: =C2*20

    #4) Now my problem, cell E3 - Correctly displaying time. I have the following formula in E3: =TIME(0,D2,0)

    This works great!! That is until the time goes beyond 24 hours, then it rolls over. I've tried right clicking and setting the custom format of E3 to [hh]:mm, it still rolls over. I’ve also tried setting formatting to d:[hh]:mm, if I do this then the output time displayed is incorrect.

    Ideally I would love a simple fix so that the time will roll over and show days. (I would like a display similar to d:hh:mm).

    I’ve done a fair bit of research online and either I'm missing something simple or this is more complex than I thought. And not to make this any more confusing, but I would love whatever I accomplish here to be useable in compatibility mode.

    I am still learning excel and did not want to ask for help, but I seem to have ran into a road block. Please Help! Thanks in advance for your assistance.

    Regards,
    Emil240

    Example (this is accurate, but then A1&B1 are close enough where it does not roll over after 24 hours):
    59.........59.........Dist..........Unit.........Time
    68.........77.........20.12........402.5......06:42
    Last edited by Emil240; 11-26-2009 at 04:11 AM. Reason: disregard, everything was correct

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