Dynamic dropdown list contents based on another cell's value

realtoast

New Member
Joined
Nov 24, 2015
Messages
32
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
I would like to create a dropdown list with elements that are based on the value of another cell (note that I do know how to create dropdown lists).

For example:

A1 is the master cell, A2 holds the dropdown list and selected value

A1 = 1, A2 list: Apples, Oranges, Lemons, Pears
A1 = 2, A2 list: IPA, Pilsner, Stout, Lager
A1 = 3, A2 list: Cotton, Wool, Nylon, Polyester
etc.

I am not proficient with VBA, so I'm hoping there's a way to do this using formulas. I did find this helpful article http://excelsemipro.com/2011/05/a-dynamic-dependent-drop-down-list-in-excel/, which I was able to mimic. But I've not figured out how to modify this process to use the master cell instead of the defined name category.

Any help appreciated!
 
Marcelo, thank you very much! I was able to get your suggestion to work!

I appreciate the help!

In case anyone else comes across this, my error was due to not understanding that, in the Data Validation Source formula, =INDIRECT("Table1[Col"&A1&"]"), "Col" was referencing the actual column name (thought it was an Excel property) and I had different header names in my table. Once I corrected the header names to Col1, Col2, etc. the dropdown list worked as intended.
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
In case anyone else comes across this, my error was due to not understanding that, in the Data Validation Source formula, =INDIRECT("Table1[Col"&A1&"]"), "Col" was referencing the actual column name (thought it was an Excel property) and I had different header names in my table. Once I corrected the header names to Col1, Col2, etc. the dropdown list worked as intended.

Yes, in a table you should use the reference to column name.
An alternative solution (better) referring the column position, instead of column name, would be something like this
1. Create a named range, with no headers, containing the 3 lists and name it, say, MyLists like below

I
J
K
1
Apples​
IPA​
Cotton​
2
Oranges​
Pilsner​
Wool​
3
Lemons​
Stout​
Nylon​
4
Pears​
Lager​
Polyester​

<tbody>
</tbody>


And use the formula below in Data Validation > List > Source
=INDEX(MyLists,0,$A$1)

M.
 
Last edited:
Upvote 0
I followed the instructions and it worked well. My columns are named "A" "B" but they are of different lengths. So "A" would have "Apple", "Ant", "B" would have "Bat", "Bump", "Banana", "Bag". So there are a few blanks at the bottom of list A. When the cell is with the dropdown is blank, it starts at the blanks space. Kind of annoying....any way to fix this?
 
Upvote 0
Maybe something like this

Assumes data in Sheet1


A
B
C
D
E
1
1​
A​
B​
2
Apple​
Apple​
Bat​
3
Ant​
Bump​
4
Banana​
5
Bag​
6

Named Range
D1:E5 --> MyLists

Create a named formula
Go to: Formulas > Names Manager > New
Name: MyRange
Refers to: =INDEX(MyLists,1,Sheet1!$A$1):INDEX(MyLists,COUNTA(INDEX(MyLists,0,Sheet1!$A$1)),Sheet1!$A$1)

Then select A2 and in Data Validation > List insert this formula
=MyRange

M.
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,784
Members
449,049
Latest member
greyangel23

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