+ Reply to Thread
Results 1 to 8 of 8

Calculating Time from Speed and Distance

  1. #1
    Forum Contributor
    Join Date
    12-15-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    202

    Calculating Time from Speed and Distance

    Hi everyone,

    I am trying to find the time from the given set of values.

    b1 - starting distance c1 - end distance(Km) d1 - speed(Kmph) e1 - time
    B C D E
    1 0.00 1.25 24 00:03:08
    2 1.25 1.75 36 00:00:50
    3 1.75 3.10 18 00:04:30
    4 3.10 3.90 28 00:01:43
    5 3.90 5.00 32 00:02:04

    The column E contains this formula
    (C1-B1)/(D1*24) and it displays the time as 00:03:08

    Now I have set of distances and I need to find the time.

    Eg:

    H1 = 1.20 in I1 I get 0:03:00
    H2 = 1.25 but in I2 I get 00:00:05

    This answer what I get in I2 is wrong.
    In I2 the answer should be 00:00:08 Seconds.
    Because both the values lies inbetween the same values of C1 but it is calculating the time from the next value.
    If the query value H1 (Distance) is not in C1 then it should add the time from E1 and then do the calculation and display the result.
    I tried using this formula
    (H2-B2)/((D2:D6)*24) but it gave correct value for the 1st value.
    Rest all I am getting wrong answers.

    The following are the values in H1:H5

    H I
    1.20 00:03:00
    1.24 00:00:06
    3.23 00:05:38
    4.44 00:02:27
    4.96 00:00:58

    Am only getting I1 as correct answer. The values in Column are correct because I did the calculation work manually.

    Could somebody help me in solving this problem.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Calculating Time from Speed and Distance

    Please attach a sample workbook with expected output for better understanding


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Calculating Time from Speed and Distance

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Contributor
    Join Date
    12-15-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Calculating Time from Speed and Distance

    File attached with explanations.

    Hope that will help.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Calculating Time from Speed and Distance

    I follow what you are asking, but do you want a macro to do this? Or just formulas?

  6. #6
    Forum Contributor
    Join Date
    12-15-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Calculating Time from Speed and Distance

    Anything which makes my job easier will be helpful.

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Calculating Time from Speed and Distance

    Here's a formula-based solution. I'm sure there's a better way to do this but formulas are not my forte.

    time calculation.xlsx

  8. #8
    Forum Contributor
    Join Date
    12-15-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Calculating Time from Speed and Distance

    Quote Originally Posted by AlphaFrog View Post
    Here's a formula-based solution. I'm sure there's a better way to do this but formulas are not my forte.

    Attachment 237149
    You are the man AlphaFrog.

    This is what am looking for.
    This forum really rocks.
    I can able to learn more things from this.

+ 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