Dynamic Named Ranges with Data Validation

Ioweyouone

New Member
Joined
Aug 14, 2009
Messages
38
Office Version
  1. 365
Platform
  1. Windows
To All: Please look at the screen shot below. I'd like D2 to be a drop down of only the States with Blue next to their name. This list would change depending on the color selected in C2. The user selects Cell C2 first. It is also a drop down with only two choices, Blue or Red. Thanks.

Screenshot 2024-03-13 164406.jpg
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Something like this? Only showing as far as Maine as per your image.

Book1
ABCD
1COLORSTATESELECT COLORSELECT STATE
2BlueAlabamaBlueAlabama
3BlueAlaskaAlaska
4RedArizonaArkansas
5BlueArkansasColorado
6RedCaliforniaConnecticut
7BlueColoradoIdaho
8BlueConnecticutIowa
9RedDelawareKansas
10RedFloridaLouisiana
11RedGeorgiaMaine
12RedHawaii
13BlueIdaho
14RedIllinois
15RedIndiana
16BlueIowa
17BlueKansas
18RedKentucky
19BlueLouisiana
20BlueMaine
Sheet1
Cell Formulas
RangeFormula
D2:D11D2=FILTER(B2:B51,A2:A51=C2,"")
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
C2ListBlue,Red
 
Upvote 0
Kevin9999, thanks for the reply but I need to clarify the objective.
I need cell D2 to be a Data Validation drop down list. Within that list, the user would only be able to select the States with the Blue next to their name. Can we use that FILTER function somehow in the validation criteria source?
 
Upvote 0
Understood. If you're OK with a helper column (say column E) then will the following work for you? (You can always hide column E if desired)
Book1
ABCDE
1COLORSTATESELECT COLORSELECT STATE
2BlueAlabamaBlueAlabama
3BlueAlaskaAlaska
4RedArizonaArkansas
5BlueArkansasColorado
6RedCaliforniaConnecticut
7BlueColoradoIdaho
8BlueConnecticutIowa
9RedDelawareKansas
10RedFloridaLouisiana
11RedGeorgiaMaine
12RedHawaii
13BlueIdaho
14RedIllinois
15RedIndiana
16BlueIowa
17BlueKansas
18RedKentucky
19BlueLouisiana
20BlueMaine
21
Sheet1
Cell Formulas
RangeFormula
E2:E11E2=FILTER(B2:B51,A2:A51=C2,"")
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
C2ListBlue,Red
D2List=E2#
 
Upvote 0
I like it. I'll start trying to work it into my sheet.
If I need to add more data past row 51, will the FILTER function automatically expand down the column?
Also, the validation list criteria for D2 is =E2#. What is the purpose of the # at the end?
 
Upvote 0
If I need to add more data past row 51, will the FILTER function automatically expand down the column?
No, instead change the formula to include the entire columns like:
Excel Formula:
=FILTER(B:B,A:A=C2,"")

Also, the validation list criteria for D2 is =E2#. What is the purpose of the # at the end?
It allows for a Spill, in other words, it doesn't matter how many cells are filled below E2 - use of the hash # will pick them up.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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