dynamic dropdown with named range

winti92

New Member
Joined
Mar 23, 2015
Messages
8
Hello

Please consider the table below. I try to create a dynamic dropdown list. My first dropdown list consists of all the Names in Column 1. The second dropdown list should then show the favorite Fruits 1, 2 and 3 of the chosen person. I used a named range for the first dropdown Table1[Name]) but don't know how to do the second one.

Can someone help me on this?

Thanks in advance!
NameFruit 1Fruit 2Fruit 3
AlexAppleBananaOrange
PeterOrangeAppleLemon
JamesAppleApricotMandarin

<TBODY>
</TBODY>
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi Winti92,

The easiest way to achieve this is to create a small table on a second sheet (which can be hidden afterwards if you prefer). The small table basically outlines what options are available for each of the choices from the first drop-down box. See my example below:


Excel 2010
ABCD
1NameAlexPeterJames
2AlexAppleOrangeApple
3PeterBananaAppleApricot
4JamesOrangeLemonMandarin
Sheet1


Once you have created your grid as above you need to define some named ranges.


Select cells A2:A4, then in the range box to the left of the formula bar type in Name
Next select cells B2:B4 and in the range box type in Alex and press enter.
Now select C2:C4 and in the range box type in Peter and press enter.
Finally select D2:D4 and in the range box type James and press enter.


Now go back to your main sheet where you want the drop-down boxes. Select where you want the first drop-down box to go (for examples sake we will say in B2), select Data Tab->Data Validation->Data Validation. Select the "List" option from the drop-down menu and then in the "Source" box type in =Name. You'll see the first drop down box on your sheet now contains the list from cells A2:A4 from the hidden sheet.


Next, move along to where you want the next drop-down box to be and select Data Tab->Data Validation->Data Validation. Select the "List" option again, but this time in the "Source" box type in =INDIRECT($B2). This will probably give a warning that the result is currently an error, but that is fine. The result it this should now look at whatever value is given in the first drop-down box in B2 and uses the answer to display the relevant list of fruits in order for the selected name.
 
Upvote 0
Hi Fishboy

Thanks for your answer. I know this option, but unfortunately my table has 100-200 rows and 7 columns. So first of all, chanching the format of the table would make it very unclear and second, I don't have the time to define 100-200 names. Especially since the entries in the table can change overtime, the dropdowns should remain flexible. Therefore I just defined the first name as all entries in column 1 of the table and want now, that in the second dropdown one can choose between the entries of column 2-7 of the respective choice from the first dropdown.
 
Upvote 0
Hi Fishboy

Thanks for your answer. I know this option, but unfortunately my table has 100-200 rows and 7 columns. So first of all, chanching the format of the table would make it very unclear and second, I don't have the time to define 100-200 names. Especially since the entries in the table can change overtime, the dropdowns should remain flexible. Therefore I just defined the first name as all entries in column 1 of the table and want now, that in the second dropdown one can choose between the entries of column 2-7 of the respective choice from the first dropdown.
In order for the name in the first drop-down box to have any relevance on the contents of next drop-down box, there needs to be a list called that name. If you have 100-200 different names that would imply 100-200 different lists, one for each name.

If you don't want to have to create that many named ranges / lists, dependent drop-down boxes might not be the way to go. You would be better off using a vlookup which would take the selected name from the drop-down box then lookup in your table to find the corresponding fruit choices of that person.

Excel 2010
ABCD
1NameFruit 1Fruit 2Fruit 3
2AlexAppleBananaOrange
3PeterOrangeAppleLemon
4JamesAppleApricotMandarin
5
6Data Validated List - Name=VLOOKUP(A6,A2:D4,2,FALSE)=VLOOKUP(A6,A2:D4,3,FALSE)=VLOOKUP(A6,A2:D4,4,FALSE)

<tbody>
</tbody>
Sheet1



Using your example data again, A6 is where the drop-down list for NAME is.
In B6 I put =VLOOKUP(A6,A2:D4,2,FALSE)
In C6 I put =VLOOKUP(A6,A2:D4,3,FALSE)
In D6 I put =VLOOKUP(A6,A2:D4,4,FALSE)

Now, when you change the selected name from the drop-down list, the 3 favourite fruits update accordingly.
 
Last edited:
Upvote 0
In order for the name in the first drop-down box to have any relevance on the contents of next drop-down box, there needs to be a list called that name. If you have 100-200 different names that would imply 100-200 different lists, one for each name.

If you don't want to have to create that many named ranges / lists, dependent drop-down boxes might not be the way to go. You would be better off using a vlookup which would take the selected name from the drop-down box then lookup in your table to find the corresponding fruit choices of that person.

Excel 2010
A
B
C
D
1
Name
Fruit 1
Fruit 2
Fruit 3
2
Alex
Apple
Banana
Orange
3
Peter
Orange
Apple
Lemon
4
James
Apple
Apricot
Mandarin
5
6
Data Validated List - Name
=VLOOKUP(A6,A2:D4,2,FALSE)
=VLOOKUP(A6,A2:D4,3,FALSE)
=VLOOKUP(A6,A2:D4,4,FALSE)

<TBODY>
</TBODY>
Sheet1



Using your example data again, A6 is where the drop-down list for NAME is.
In B6 I put =VLOOKUP(A6,A2:D4,2,FALSE)
In C6 I put =VLOOKUP(A6,A2:D4,3,FALSE)
In D6 I put =VLOOKUP(A6,A2:D4,4,FALSE)

Now, when you change the selected name from the drop-down list, the 3 favourite fruits update accordingly.

thanks for your help. but unfortunately that is not an option for me, since I need to be able in the tool to choose a fruit. And dependent on the fruit choice other cells will be filled in. So I really need to choose a name and then the fruit.
 
Upvote 0
isn't there a possibility to insert a function in data validation so that it looks up the value from B2 in a specific table and outputs then the 8 options on the right side of the elected value in this table?
 
Upvote 0
isn't there a possibility to insert a function in data validation so that it looks up the value from B2 in a specific table and outputs then the 8 options on the right side of the elected value in this table?

Winti,

Here is a link to a file I put together for another member that relies on a solution I often use for this purpose. This concept came from the brain of Jerry Beaucaire and I have just customized it a bit for my normal application.

You can either enter your options for selections on Sheet 1, which will then automatically be entered into the setup required for the data validation to work (On DV Lists sheet), or you can enter them directly on the DV Lists sheet. Just clear out the formulas from that sheet if that is the route you choose.

https://www.dropbox.com/s/inex3shhqix6t89/Cascading DV_Ajnaaslam.xlsm?dl=0
 
Upvote 0

Forum statistics

Threads
1,215,221
Messages
6,123,699
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top