+ Reply to Thread
Results 1 to 11 of 11

How to create a Dropdown list that returns values that depends on another cell

  1. #1
    Registered User
    Join Date
    08-26-2009
    Location
    SEA
    MS-Off Ver
    Excel 2007
    Posts
    18

    How to create a Dropdown list that returns values that depends on another cell

    How do I create a dropdown list that returns values
    DEPENDING on what I enter in another cell.

    I've attached my excel sample file so that you can better understand my problem. Thanks in advance. This forums has been very helpful.
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to create a Dropdown list that returns values that depends on another cell

    This is known as dependent data validation, Contextures have an excellent tutorial.

    Put briefly, using your sample file...

    1 - highlight L6:L8 and name range ABC
    2 - highlight L10:L12 and name XYZ
    3 - to B7 apply a Validation of List with a source of: =INDIRECT(A7)

  3. #3
    Registered User
    Join Date
    08-26-2009
    Location
    SEA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to create a Dropdown list that returns values that depends on another cell

    Thanks for all the help so far DonkeyOte.
    I've read the tutorial you recommended, and I decided to use the 'OFFSET' function. I've managed to make a dropdown list that depends on the value of another cell.

    However, I'm having problem creating a dependent dropdown list that depends on the values entered on two cells instead of just one value.

    To illustrate, let's say there are 3 columns in an invoice. The first one is a dropdown list for the product where you can choose which product to enter. The next column is a dependent dropdown list that returns the product type available based on the value entered on the product column. Column 3 is the size column. The size available depends on the product and the type entered. So, what formula can I use here to create a list that depends on two values?

    I've attached my sample workbook to better illustrate.
    Thanks a lot!
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to create a Dropdown list that returns values that depends on another cell

    One possibility might be:

    Please Login or Register  to view this content.
    Utilised then

    Please Login or Register  to view this content.
    If you don't have too much data the above shouldn't be too horrendous performance wise...

    Note: you must make sure your lists tie out exactly (in terms of spelling errors etc) - for ex. note spelling of Matress on B10 on Price List sheet...

  5. #5
    Registered User
    Join Date
    08-26-2009
    Location
    SEA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to create a Dropdown list that returns values that depends on another cell

    DonkeyOte

    Thanks for the reply and thanks for the tip
    I tried putting your formula but unfortunately it didn't work. I tried using your formula as is and put it in the Size column Data validation in the Invoice workbook. I also tried naming the ranges before putting the formula in the Data Validation. However, all didn't work. I didn't know what could be wrong. If you don't mind, can you put the formula in my sample invoice workbook? I could be missing some things since I didn't really understand Excel.

    Thanks a lot for your time and effort! I've attached the updated sample invoice workbook with the correct spelling.
    Attached Files Attached Files

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to create a Dropdown list that returns values that depends on another cell

    There's no great value in me doing this for you, I believe you need to be able to do this yourself going forward... so open your last file then:

    Please Login or Register  to view this content.
    Now go to sheet Invoice and highlight range C10:C20 and then:

    Please Login or Register  to view this content.
    As you alter A10 & B10 on Invoice sheet you should find the Size options alter accordingly... eg select Accessories - Pillow and you find 1 size only, change to Mattress and you have a multitude of options.

  7. #7
    Registered User
    Join Date
    08-26-2009
    Location
    SEA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to create a Dropdown list that returns values that depends on another cell

    Hello DonkeyOte,

    I've followed your instructions step by step but I still couln't make it work.
    In the Size column, only value "_Size" appear no matter what Product and Type I choose.

    FYI, I changed the " , " in the formula to " ; " since I'm in a different region than you are. I was wondering if that could be a problem?

    Also, did the formula work when you tried it?

    Thanks

  8. #8
    Registered User
    Join Date
    08-26-2009
    Location
    SEA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to create a Dropdown list that returns values that depends on another cell

    Nevermind, I finally got it.
    I went through everything over and over and finally found what I missed.
    I missed one " = " in the Data validation column.

    One question, do you have to name ranges/references before they are to be entered in the Data Validation formula ? Because sometimes I get a message that "you cannot make references". Something like that. So, I just named some of my ranges, and then they worked. I'm not sure about it though.

    Also, can you explain the logic of the last formula you gave me? I'm lost on what it actually does. I understand the first part where it compares two values and extract the third value that match those two criterias. However, I don't really understand the use of SUMProduct in this situation.

    Btw, Thanks a lot Donkey Ote, I appreciate your help.

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to create a Dropdown list that returns values that depends on another cell

    see attached

    (when opened formulae will translate automatically per your regional settings)

    note:

    given use of XL2007 I've revised the named range formula and replaced the SUMPRODUCT with COUNTIFS (excl. to XL2007) given the latter is more efficient.

    The formula essentially finds the first match of Product & Type on the Validation Lists sheet and then creates a range from that point where the number of rows (height in OFFSET) is determined by the number of times that combination appears in the list, it is obviously dependent upon the Validation List being sorted by Product & Type (ie all entries are listed in sequence).
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-15-2013
    Location
    Anchorage, Alaksa
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: How to create a Dropdown list that returns values that depends on another cell

    I am also working on something of the same. My figured out how to do a drop down list. That was easy. No I would like to be able to use the drop down list in one column, click on the item and then have the coorespondong invoice number appear. I created a drop down list for the invoices already, so I want to be able to Use the client's name to get to the invoice number without having to look it up.

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

    Re: How to create a Dropdown list that returns values that depends on another cell

    skgolley,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    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)

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