Forum Discussion
Anyone know how to make a dropdown list dependent on the contents of 2 other dropdowns?
Hi Sergei!
Thanks for the quick response! I tried this method but this doesnt seem scalable to large quantities of data as i would have to make multiple verticals per state. Im actually working on the entire philippines and have attached the sample data to help clarify would you happen to know of any alternative?
Hi Francis,
Okay, i see the point. Will play with this bit later.
- SergeiBaklanAug 18, 2017Diamond Contributor
Hi Francis,
I continue with your data structure, the only uses your Tables instead of ranges like $A:$A - better at least from performance point of view.
Instaed of Table1`,.. they are renamed as Province, ProvinceCity and AllData.
Name of the used columns are added to list of names (see in Names Manager), references as here
Thus for the first list (Province) the formula is
=INDIRECT(ProvinceList)
(to work with tables we have to use INDIRECT, structured references don't work within list formulas)
Next one for the City which depends on Province is actually as yours, only in tables notation
=OFFSET(Lists!$D$1,MATCH(A2,INDIRECT(PCProvince),0),1,COUNTIF(INDIRECT(PCProvince),A2),1)
For the third list we shall filter selected Province and City what we do in MATCH with AND condition; and number of rows is calculated by COUNTIFS with two conditions (instaed of COUNTIF)
=OFFSET(Lists!$G$1,MATCH(1,(INDIRECT(AllProvince)=A2)*(INDIRECT(AllCity)=B2),0),2,COUNTIFS(INDIRECT(AllProvince),A2,INDIRECT(AllCity),B2),1)
The file is attached
- TrevelyanJan 21, 2020Copper Contributor
SergeiBaklan I stumbled across this post from over two years ago and it fits an issue I am trying to resolve as well. I followed the listing.xls file you posted but the dropdown in column C does not appear to be working. Something seems to be wrong with the data validation in that column as none of the Barangay dropdowns work. Do you know what needs to be fixed in the validation formula for this dropdown? Id like to apply the concept to a Dependent Validation drop down table I have setup but cant get it to work.
- SergeiBaklanJan 22, 2020Diamond Contributor
For last 3 cells I use named formula for data validation and it works. For thirst 3 it is direct formula and it doesn't work after re-opening.
Will play some more with that, but later.