Cascading dropdown lists from dynamic ranges

devunow

New Member
Joined
Apr 15, 2008
Messages
16
I wish to create a cascading dropdown list of towns dependent on which country is chosen. (as below)
The lists of towns varies and I wish the ranges on this to be dynamic.
At present I use: =OFFSET(Lists!$D$2:$D$2,0,0,MATCH("*",Lists!$d:$d,-1),1) to calculate the ranges.
The secod dropdown list does not work with the usual INDIRECT function. Is there something else I need to do because the lists are dynamic?

Excel Workbook
ABCDEFGHIJK
1CountiresCanadaUSAUKSpainItalyFranceDropdown Lists Below:
2CanadaOttawaNew YorkLondonBarcelonaMilanMarseillesCountryCity
3USATorontoChicagoManchesterMadridVeniceNiceUK
4UKVancouverMiamiGlasgowValenciaRomeParis
5SpainSeattleTurin
6Italy
7France
Lists
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Ah, have worked it out!

If you define a name using EVALUATE it will work with dynamic ranges. Choose Insert, Name, Define from the menu, enter List2 (or whatever name you care to choose) and in the refers to box enter this:
=EVALUATE(Sheet1!$J$3)
adjusting the sheet name if required. Then use =List2 as the list source for the second data validation.
 
Upvote 0
Oh dear, though the evaluate function works, I need to define a new list for every dropdown menu I create - is there an easier way?
 
Upvote 0
Suppose you name Countries = $A$2:$A$7, then, I normally use two methods:

1. Naming each city list as dynamic named range, such as Canada = OFFSET($C$2,0,0,COUNTA($C$2:$C$1000),1) and USA = OFFSET($D$2,0,0,COUNTA($D$2,$D$1000),1) and so on. Then, naming CityList = CHOOSE(MATCH($j$3,Countries,0),Canada,USA,UK,Spain,Italy,France). Finally, in K3, create the validation list with =CityList in source: box.

2. If you are not prefer to name each list of city, define name Countries as above, then I name the CityList

=OFFSET($B$2,0,MATCH($J$3,Countries,0),COUNTA(OFFSET($B$2,0,MATCH($J$3,Countries,0),1000,1)),1)

and create validation list at K3 using name CityList at source box.

Hope it can help.
 
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,102
Members
452,379
Latest member
IainTru

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