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.
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.
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)
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
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!
One possibility might be:
Utilised thenPlease Login or Register to view this content.
If you don't have too much data the above shouldn't be too horrendous performance wise...Please Login or Register to view this content.
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...
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.
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:
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.Please Login or Register to view this content.
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
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.
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).
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.
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]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks