+ Reply to Thread
Results 1 to 9 of 9

Selecting a cell value below a cell with a known value

  1. #1
    Registered User
    Join Date
    11-10-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    6

    Selecting a cell value below a cell with a known value

    Hi,

    What I am trying to do is select a value (value 2), which is in the cell below another, known, value (Value 1). I have performed a calculation with Value 1, and want to now perform the calculation with Value 2. Subsequently, I will want to repeat the calculation with Value 3, 4,....n. These values are the starting point for a series of calculations in separate tables.

    Currently I am trying to do this by finding the location of the cell (Value 1), which is in a different worksheet, and I know the value this cell has. I then want to select the value of the cell directly BELOW the first cell found (Value 2).

    How do I do this? I would like to use formulas as opposed macro's or VBA. If you need any more detail let me know.

    Thanks,

    Tom.

    If it helps, here is the context of the problem:

    A car is accelerating in a straight line of length L. It starts at a known velocity V1, and must end at a known velocity V2. I am trying to find the quickest time the car can do this in. I am trying to find the point at which the car should begin braking (if it needs to brake at all, but let's assume that it will). I am currently trying to do this by calculating the braking time at a range of velocities, and selecting the combination which most closely matches, but does not exceed distance L when the acceleration and braking distances are added together.

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

    Re: Selecting a cell value below a cell with a known value

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

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

    View Pic
    but you could probably just use match with index
    index(sheet2!a1:a100,match(yourvalue,sheet2!a1:a100,0)+1)
    "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

  3. #3
    Forum Contributor amit.wilson's Avatar
    Join Date
    07-09-2013
    Location
    Gotham
    MS-Off Ver
    Excel for Mac 2011
    Posts
    283

    Re: Selecting a cell value below a cell with a known value

    Hi - you could try this

    1. find the address of the cell with the Value 1 using the function Match().

    2. Use the next cell (in the row below), containing Value 2 with the functions Cell() and Offset().

    If you upload a sample sheet, I could help with the formulas.

    Cheers
    <-- If you're happy & you know it...click the star.:-)

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

    Re: Selecting a cell value below a cell with a known value

    thats not necessary if you can match the cell then you just use match()+1

  5. #5
    Forum Contributor amit.wilson's Avatar
    Join Date
    07-09-2013
    Location
    Gotham
    MS-Off Ver
    Excel for Mac 2011
    Posts
    283

    Re: Selecting a cell value below a cell with a known value

    Yes that's far more elegant. Thanks martindwilson.

    Cheers

  6. #6
    Registered User
    Join Date
    11-10-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Selecting a cell value below a cell with a known value

    Hi,

    Thanks for the quick response. Here is a sample worksheet. Normally the data would note be on the same worksheet, and I'd like the formula to work regardless of what any of the figures are - they will change. For simplicity, I have not included the other data/calculations, they shouldn't impact on this formula anyway.

    example sheet.xlsx

    Regards,

    Tom

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

    Re: Selecting a cell value below a cell with a known value

    you say closest is that above or below?
    assumin its below
    then see attached
    note for any type of close match the values in col b must be sorted ascending(or possibly descending for nearest highest using match)
    Attached Files Attached Files
    Last edited by martindwilson; 11-10-2013 at 03:35 PM.

  8. #8
    Registered User
    Join Date
    11-10-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    6

    Thumbs up Re: Selecting a cell value below a cell with a known value

    Spot on!

    Thank you very much for this - many hours spent head scratching over this!!

    Tom

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Selecting a cell value below a cell with a known value

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 09-29-2013, 06:12 PM
  2. Replies: 9
    Last Post: 01-19-2013, 12:33 PM
  3. Replies: 2
    Last Post: 06-03-2012, 03:33 PM
  4. [SOLVED] How to select cell to the right of active cell without selecting the activecell aswell?
    By Emmaly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2012, 07:22 AM
  5. VBA - Selecting a cell based on relative position vs cell #
    By jago_ML in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-08-2007, 03:04 AM

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