Dependant data validation dropdown list

eduzs

Well-known Member
Joined
Jul 6, 2014
Messages
704
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
My worksheet has a range like (hypothetical, just an example):
Type: Name:
1 Orange
1 Blue
2 White
2 Green
2 Black
What I want to do is, when A1 value is "1" or "2" the dropdown/data validation in B1 will show only the correpondent names.
A1="1", shows "Orange, Blue"
A2="2", shows "White, Green, Black"
Is that possible without VBA or creating subtables for each type?
Thanks.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
dependent dropdoowns.jpg


Cannot use 1 and 2 as names for named ranges (not permitted names)

Use a helper column B to "convert" 1 to ONE and 2 to TWO (permitted names)
formula :
=CHOOSE(A2,"ONE","TWO")

Create named ranges ONE and TWO containing required values

Data validation formula in C2
=INDIRECT(B2)
 
Upvote 0
Is that possible without VBA or creating subtables for each type?
Depends what Excel version you are using. I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

IF you have Excel 365 with the FILTER functions then you might be able to use this.

Place the formula shown in F1 only and the other results will automatically 'spill' down the column.
Then set up the simple Data Validation as shown below,

20 05 10.xlsm
ABCDEF
12TypeNameWhite
21OrangeGreen
31BlueBlack
42White
52Green
62Black
7
Dependant DV
Cell Formulas
RangeFormula
F1:F3F1=FILTER(E2:E6,D2:D6=A1,"")
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
B1List=F1#


Result:
1589114645969.png
 
Upvote 0
Now I'm using both Word 2019 and Word 2010, sheet/vba code should work both version.
I believe that it is not possible to create an all-in-one (single function, no additional range/columns needed) data validation /dropdown list, so currently I'm using another solution.
Thanks!
 
Last edited:
Upvote 0
Now I'm using both Word 2019 and Word 2010,
Presumably you mean Excel in relation to this forum. :)
It still would help if you put those versions in your profile so helpers always know and don't waste time developing solutions that are irrelevant because of your version(s).
I see that you have Excel 2010 in your signature but not 2019. In any case, in this new forum, helpers will more likely be looking left for your version(s) not at your signature.

1589120163381.png
 
Upvote 0
Sorry, I mean Excel. ?
I will update my account details.
Looking here in my old notes I found a formula (list validation rule) that works perfectly!
=OFFSET(Tables!$A$1,MATCH(F2,Tables!$A$1:$A$10,0)-1,1,COUNTIF(Tables!$A$1:$A$10,F2))
(translated)
Where:
Tables!A1:A10 = table of Types and colors with column label (1st row).
F2 = user select a type
This formula only requires that the table be in order of "types" and "colors" in alphabetical order.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,271
Members
452,628
Latest member
dd2

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