Shanan212
asked on
Dependent Data Validation
Hi,
I have few hundred cities & provinces in one column
Eg: Calgary, AB (City, province)
Next column has 'store names'
eg: Store 1
On the main page, user can type in/choose city via data validation.
Now I want to give the user a chance to select the store location via another data validation list but those that comes in within the user-selected city, province only
Whats the best way to do this without going into VBA? (using formulas only)
Any other ways without using macros?
I have few hundred cities & provinces in one column
Eg: Calgary, AB (City, province)
Next column has 'store names'
eg: Store 1
On the main page, user can type in/choose city via data validation.
Now I want to give the user a chance to select the store location via another data validation list but those that comes in within the user-selected city, province only
Whats the best way to do this without going into VBA? (using formulas only)
One way is, assign stores with same city under a named range
Say I create a named range of "B2:B15" as 'Calgary, AB'
Assuming user chooses city on cell A1 and store on cell A2
on A2, I can do data validation as
= indirect($A1)
However, this would require 100s of named ranges (or 1 for each city)
Say I create a named range of "B2:B15" as 'Calgary, AB'
Assuming user chooses city on cell A1 and store on cell A2
on A2, I can do data validation as
= indirect($A1)
However, this would require 100s of named ranges (or 1 for each city)
Any other ways without using macros?
If you can list all the cities and corresponding stores grouped together.
e.g..
Calgary, AB......Store1
Calgary, AB......Store2
Calgary, AB......Store3
Toronto, ON.....Store4
Toronto, ON.....Store5
Toronto, ON.....Store6
Toronto, ON.....Store7
Vancouver, BC..Store8
Vancouver, BC..Store9
... etc. (those are 2 columns)
then call this range something like MyRange
Then in your data validation, use List and enter formula:
=OFFSET(INDEX(MyData,1,2), MATCH($E$2,INDEX(MyData,0,1),0)-1,0, COUNTIF(IN DEX(MyData ,0,1),$E$2),1)
where E2 is the cell with the City dropdown input.
Copy-of-Test-2.xlsx
e.g..
Calgary, AB......Store1
Calgary, AB......Store2
Calgary, AB......Store3
Toronto, ON.....Store4
Toronto, ON.....Store5
Toronto, ON.....Store6
Toronto, ON.....Store7
Vancouver, BC..Store8
Vancouver, BC..Store9
... etc. (those are 2 columns)
then call this range something like MyRange
Then in your data validation, use List and enter formula:
=OFFSET(INDEX(MyData,1,2),
where E2 is the cell with the City dropdown input.
Copy-of-Test-2.xlsx
ASKER
NB,
The listing part wouldnt work as this data (listing in corresponding order) is not up to me. The user would be entering this and might screw-it up.
ssaqibh,
Please see attached.
Thanks!
Copy-of-Copy-of-dropDownbreakDow.xlsm
The listing part wouldnt work as this data (listing in corresponding order) is not up to me. The user would be entering this and might screw-it up.
ssaqibh,
Please see attached.
Thanks!
Copy-of-Copy-of-dropDownbreakDow.xlsm
That method works horizontally. The sub-list has to be entered to the right of the selected item.
If you want to enter the DV items vertically then follow NB_VC's method.
If you want to enter the DV items vertically then follow NB_VC's method.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thats some next level stuff :)
Thanks!
Thanks!
https://www.experts-exchange.com/questions/28002175/Choices-For-DropDown.html