+ Reply to Thread
Results 1 to 7 of 7

Time-Distance Caluculations

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    Florida
    MS-Off Ver
    Excel for Mac 2011 Ver 14.3.1
    Posts
    3

    Exclamation Time-Distance Caluculations

    I am having a bit of a problem in calculating the time-distance results for the following:
    In an attempt at figuring out the expected costs for (potential) routine travel, including everything from distance, time (one-way), gas (per gal), MPG, etc., etc., I continue to run into the (simple?) problem of correctly calculating driving time.

    A1: Destination: e.g., Nashville, TN
    B1: Miles One-way: e.g., 693.4
    C1: Trip Count: e.g., 36
    D1: Total Miles: e.g., =B1*C1 {24,962.40}
    E1: Avg (per gal) Gas Price: e.g., $3.75
    F1: Avg MPG: e.g., 26
    G1: Annual Totals: e.g., =(D1/F1)*E1 {$3,600.35}
    H1: Hrs Travel One-way: e.g., 10:14
    I1: Total Hrs: e.g., =H1*C1 {Result=8:24, when the correct answer would be: 365.4}

    I have, after reading many related posts, attempted to change formula in about a half-dozen ways, but to no avail.

    I cannot believe that this is nothing more than a simple syntax error that I simply cannot put my finger on. Can you help???

    PCo*

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Time-Distance Caluculations

    Format the result as [h]:mm
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Time-Distance Caluculations

    You have to convert the TIME in hours minutes ( 10:14 ) into a decimal (10.2333) before you do your multiplication.

    Try this:

    =((H1-INT(H1))*24)*C1

    The answer should be 368.4

  4. #4
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Time-Distance Caluculations

    Curious, getting two different values.

    [H]:MM returns 368:24:00

    =((H1-INT(H1))*24)*C1 returns 368.4

    Edit Added:

    Never mind, my mind is mush.

    One is TIME & one is Decimal.

  5. #5
    Registered User
    Join Date
    03-19-2013
    Location
    Florida
    MS-Off Ver
    Excel for Mac 2011 Ver 14.3.1
    Posts
    3

    Re: Time-Distance Caluculations

    And like a champ, the formula resolves the issue. Thanks* One follow-on question if I may... I noticed (when attempting to follow along with the formula's breakdown) that you've included an operand for Integer expression of "H1" within but I failed to see why? Don't get me wrong, the formula (provided) works perfectly, but in trying to make sense (for my own ability to remember what... and why this was done) I was unable to connect the dots here. Also, when I attempted to produce the formula without the INT operand it simply would not work (which then really baffled me)???

    I remained confused, but for a completely different reason now.

    Thanks again for the quick (and effective) response.
    PCo*

  6. #6
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Time-Distance Caluculations

    It's a bit complicated, but I'll give it a shot.

    First you need to know that Excel calculates TIME as a percentage of a 24 hour Day.
    So, to you, it may be 12:00 PM, but to Excel it is 0.50 or fifty percent of the day.
    To see for yourself, put the TIME 12:00 PM in a cell, then format that cell as Number.

    Now if we put your TIME of 10:14 AM, which to you means 10 hours 14 minutes, in to a cell, Excel sees 0.426388888888889
    nowt since it's a TIME cell, to do any work we need to convert the TIME into a Decimal number,
    and the H1-INT(H1) simply converts the TIME into a decimal number, it does the same as H1-0,
    we then multiply by 24 hours to gets our 10 hours, and, now what was 14 minutes, is converted to .2333 of the Day.
    so we end up with the Decimal number 10.2333, which we now multiply by 36 Trips to get the total of 368.4 hours.

    Hope that make sense.

    Not sure if Excel for the MAC is the same as for Windows,
    but look on the Ribbon,
    under the Formula Tab,
    for the Formula Auditing section.
    There is an Evaluate Formula button, it will "walk you through" the formula.
    Very handy in trying to figure out how a specific formula works.

  7. #7
    Registered User
    Join Date
    03-19-2013
    Location
    Florida
    MS-Off Ver
    Excel for Mac 2011 Ver 14.3.1
    Posts
    3

    Re: Time-Distance Caluculations

    Well-done (appreciate the extension of your experience).

    PCo*

+ 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