+ Reply to Thread
Results 1 to 8 of 8

Speed Distance Time formula

  1. #1
    Registered User
    Join Date
    01-11-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Speed Distance Time formula

    Hi,

    I've wondered this for a while.

    Say cell A1 is Speed, B1 is Distance, C1 is Time.

    I want to write a formula in each cell that is dependant on the value of the other two but I don't want the value I enter to overwrite the formula.

    For eg. I want to calculate time so I enter values in the distance and speed cells. I then want to calculate speed so I delete what I previously entered in the speed cell and overwrite the answer it just gave me for time with my new value.

    Is there a simple inbuilt function to do this?

    Thanks

    Rob

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Speed Distance Time formula

    Input cells and formula cells must be independent. If you have a formula cell and then enter a value into the same cell, the formula is over-written.

    I suggest you set up the input cells for each variable and include an additional cell for a single letter entry of T, D, or S as a flag for which calculation to perform. Then in the formula cell test the value of the flag and perform the calculation:

    If A1 was the "flag" cell, we might use:

    =IF(A1="T",time formula,IF(A1="D",distance formula,speed formula))

    S formula becomes the default calculation in the above formula.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  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: Speed Distance Time formula

    nope youll have to repeat , values in any 2 of three cells and then 3 different calculations in other cells
    like this
    Attached Files Attached Files
    "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
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Speed Distance Time formula

    Just a note...keep your units of measure apples to apples so the result will make sense.
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  5. #5
    Registered User
    Join Date
    01-11-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Speed Distance Time formula

    Thanks guys, I know you can do it this way but just thought there may be something simpler.

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

    Re: Speed Distance Time formula

    how simple do you want it!that is probably as simple as excel formulas get,now someone could probably write code to do it but would that be simpler?

  7. #7
    Registered User
    Join Date
    01-11-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Speed Distance Time formula

    Quote Originally Posted by martindwilson View Post
    how simple do you want it!that is probably as simple as excel formulas get,now someone could probably write code to do it but would that be simpler?
    Thanks Martin but the format of my spreadsheet does not lend itself to your way of doing it.

    I only used the speed distance time as an example as this is a very simple formula.

    I actually need it for a much more complex formula I just wanted to know if I there was a built-in excel function that allows a group of cells to be linked by a common formula of which each cell is assigned a specific part of the formula so that changing any one value will change the rest in that group but as it turns out, there isn't.

    Of course writing code would be harder and I don't expect anyone to do that!!

  8. #8
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Speed Distance Time formula

    I actually need it for a much more complex formula I just wanted to know if I there was a built-in excel function that allows a group of cells to be linked by a common formula of which each cell is assigned a specific part of the formula so that changing any one value will change the rest in that group but as it turns out, there isn't.
    If you could provide a small example sheet with what you want to do ,we could probably find a solution to your problem

+ 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