+ Reply to Thread
Results 1 to 5 of 5

Formula to show an adjacent cell to the one picked in a data validation list

  1. #1
    Registered User
    Join Date
    02-14-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    3

    Formula to show an adjacent cell to the one picked in a data validation list

    Hi All,

    I have a source range as shown in the attachment below.

    Data source.JPG

    On another sheet I have two data validation lists.

    In the first list, the user can choose either Fruit, Vegetable or Meat.

    The second list is dependent on the first list. It will provide a user a choice of either Fruit, Vegetables or Meat depending on what was chosen in the first list. E.g. if the user picked Vegetable in the first list, the second list will give him/her the option of Lettuce, Tomato, Carrot or Avocado.

    List filtered.jpg

    Say the user picks Lettuce. I was there to be a cell elsewhere the displays the price of Lettuce. In this case, it would show 2.5 (value in cell D2).

    Assumptions:
    - the price of the object is always in a cell adjacent and to the right of the item in the data source table.

    Issues:
    - as you can see, due to the nature of the columns vlookup and match isn't really an option (unless there is a clever way to do this)
    - you can't simply create code to look up the end result as you have items like Avocado which appear in both lists.
    - items like Avocado may appear in multiple columns, but the price may differ in each column. This again rules out the ability to just search an string containing "Avocado" and returning the price.

    This data is test data created for this example. I'm afraid I can't provide the real data due to work confidentiality. Happy to answer any questions.

    Appreciate the help.

    s.
    Attached Images Attached Images

  2. #2
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Formula to show an adjacent cell to the one picked in a data validation list

    Can you please upload a workbook with the sample data in the image files you posted. A solution is possible, but I need the sample workbook to test it.
    Please click the * icon below if I have helped.

  3. #3
    Registered User
    Join Date
    02-14-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Formula to show an adjacent cell to the one picked in a data validation list

    Attached the a sample sheet which replicates the original.

    Thanks
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Formula to show an adjacent cell to the one picked in a data validation list

    I think there is a better way to do this, but this will work fine.
    I've added a couple columns in the "Shopping Sheet" (Columns B & C) and that will make it possible to use the INDEX & MATCH functions.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-14-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Formula to show an adjacent cell to the one picked in a data validation list

    Wow this is great, thanks very much. I'll have to hide the formula columns but this shouldn't be a problem. Thank you!

+ 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