Drop Down List and Sub-lists of Differing Sizes

EasterGreen

Board Regular
Joined
Sep 7, 2009
Messages
50
I want to use a drop down menu to select any 1 of x areas, let's say these are the States where we have sales people. That's ok with Data Validation/Lists.
Each sales area or State may have between 5 and 20 counties where we have customers.
How can I select a State and then have each county populate into a range below? I can then do lookups by county for a variety of data points.
See attached image for what I mean.
Grateful for any help.
Image 1.jpg

Stretch goal!
The number of rows where the list of counties can populate can be fixed to a maximum so I can have a predictable location of a total row, but could it also be dynamic?
That is, the total will move up and down as the population above it changes.
 
There's a lot going on here. The Unique Area list is a dynamic range named Area_List. The Yellow table is an Excel Table and named ACCS_Tbl. The County Filter and the Customer Filter are also dynamic named ranges called County_list and Customer_List.

The formula for the Area_List is: =OFFSET(Sheet3!$B$1,1,0,MATCH("zzzzzzzzzzzzzz",Sheet3!$B:$B)-ROW(Sheet3!$B$1),1)
The formula for the County_List is: =OFFSET(Sheet3!$J$1,1,0,MATCH("zzzzzzzzzzzzz",Sheet3!$J:$J)-ROW(Sheet3!$J$1),1)
The Formula for the Customer List is: =OFFSET(Sheet3!$L$1,1,0,MATCH("zzzzzzzzzzzzzz",Sheet3!$L:$L)-ROW(Sheet3!$L$1),1)

I didn't know if you wanted to carry your dependent validations out to the customer names.

How this works is you first choose an Area from the AreaSelection. Then you choose a County, then a Customer. The sales field will sum the values based on those 3 criteria. In real time you can see the changes to the lists when you choose each selection.

Have fun.



Book2.xlsm
BCDEFGHIJKLMNOPQR
1Unique AreasAreaCountyCustomerSalesCounty FilterCustomer FilterArea SelectionCounty SelectionCustomer SelectionSales
2Area1Area1County1_01Customer01454County3_01Customer06Area3County3_05Customer06 $ 245.00
3Area2Area1County1_02Customer02600County3_02
4Area3Area1County1_03Customer03242County3_03
5Area4Area1County1_04Customer04382County3_04
6Area1County1_05Customer05115County3_05
7Area1County1_06Customer06827County3_06
8Area1County1_07Customer07384County3_07
9Area1County1_08Customer0841County3_08
10Area2County2_01Customer01986County3_09
11Area3County3_01Customer02393County3_10
12Area3County3_02Customer03531County3_11
13Area3County3_03Customer04218County3_12
14Area3County3_04Customer05499County3_13
15Area3County3_05Customer06245County3_14
16Area3County3_06Customer07760County3_15
17Area3County3_07Customer08863County3_16
18Area3County3_08Customer01872County3_17
19Area3County3_09Customer02168County3_18
20Area3County3_10Customer03379County3_19
21Area3County3_11Customer04696
22Area3County3_12Customer05722
23Area3County3_13Customer06857
24Area3County3_14Customer07329
25Area3County3_15Customer0834
26Area3County3_16Customer01158
27Area3County3_17Customer02621
28Area3County3_18Customer03942
29Area3County3_19Customer04279
30Area4County4_01Customer05794
31Area4County4_02Customer06602
32Area4County4_03Customer07193
33Area4County4_04Customer08737
34Area4County4_05Customer01313
35Area4County4_06Customer02958
Sheet3
Cell Formulas
RangeFormula
J2:J20J2=FILTER(ACCS_Tbl[County],ISNUMBER(SEARCH(AreaSelection,ACCS_Tbl[Area])),"Not Found")
L2L2=FILTER(ACCS_Tbl[Customer],ISNUMBER(SEARCH(CountySelection,ACCS_Tbl[County])),"Not Found")
R2R2=SUMIFS(ACCS_Tbl[Sales],ACCS_Tbl[Area],AreaSelection,ACCS_Tbl[County],CountySelection,ACCS_Tbl[Customer],CustomerSelection)
Dynamic array formulas.
Named Ranges
NameRefers ToCells
AreaSelection=Sheet3!$O$2R2, J2
CountySelection=Sheet3!$P$2R2, L2
CustomerSelection=Sheet3!$Q$2R2
Cells with Data Validation
CellAllowCriteria
O2List=Area_List
P2List=County_list
Q2List=Customer_List
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Wow, thanks. Hadn't really investigated OFFSET before.
Will give this a try and let you know.
I appreciate your time.
 
Upvote 0
Perhaps I have not fully understood the requirement here but it seems to be way over-complicated to me.
It looks like for the moment we are assuming the dynamic array functions are in play (even though not all Excel 365 customers have them yet) and that we are trying to set up lists for Data validation of areas/counties/customers that are in the sales transactions table.

If we have the dynamic array functions, then there is no need for any named ranges, but in particular no need for the complication of setting up dynamic named ranges as the dynamic array functions have a built-in way to refer to there 'spill ranges' directly.

See if this would suffice (I have changed some of this ample data)

Formulas in columns I:K are entered in row 2 only and the other results automatically 'spill' to any required rows.
If you want, columns I:K could then be hidden.

Very simple Data Validation, without dynamic named ranges, is shown below.
I have included two options for obtaining the Sales figure.

EasterGreen 2020-05-16 1.xlsm
CDEFGHIJKLMNOPQ
1AreaCountyCustomerSalesUnique AreasCounty FilterCustomer FilterArea SelectionCounty SelectionCustomer SelectionSalesSales
2Area1County1_01Customer01454Area1County3_01Customer07Area3County3_06Customer0415531553
3Area1County1_02Customer02600Area2County3_02Customer01
4Area1County1_03Customer03242Area3County3_03Customer04
5Area1County1_04Customer04382Area4County3_04
6Area1County1_05Customer05115County3_05
7Area1County1_06Customer06827County3_06
8Area1County1_07Customer07384County3_07
9Area1County1_08Customer0841County3_08
10Area2County2_01Customer01986County3_10
11Area3County3_01Customer02393County3_09
12Area3County3_02Customer03531County3_16
13Area3County3_03Customer04218County3_17
14Area3County3_04Customer05499County3_18
15Area3County3_05Customer06245County3_19
16Area3County3_06Customer07760
17Area3County3_07Customer08863
18Area3County3_08Customer03872
19Area3County3_06Customer01168
20Area3County3_10Customer05379
21Area3County3_06Customer04696
22Area3County3_07Customer08722
23Area3County3_06Customer04857
24Area3County3_09Customer02329
25Area3County3_10Customer0334
26Area3County3_16Customer01158
27Area3County3_17Customer02621
28Area3County3_18Customer03942
29Area3County3_19Customer04279
30Area4County4_01Customer05794
31Area4County4_02Customer06602
32Area4County4_03Customer07193
33Area4County4_04Customer08737
34Area4County4_05Customer01313
35Area4County4_06Customer02958
36
Sheet1
Cell Formulas
RangeFormula
I2:I5I2=UNIQUE(ACCS_tbl[Area])
J2:J15J2=UNIQUE(FILTER(ACCS_tbl[County],ACCS_tbl[Area]=M2,""))
K2:K4K2=UNIQUE(FILTER(ACCS_tbl[Customer],(ACCS_tbl[Area]=M2)*(ACCS_tbl[County]=N2)))
P2P2=SUMIFS(ACCS_tbl[Sales],ACCS_tbl[Area],M2,ACCS_tbl[County],N2,ACCS_tbl[Customer],O2)
Q2Q2=SUM(FILTER(ACCS_tbl[Sales],(ACCS_tbl[Area]=M2)*(ACCS_tbl[County]=N2)*(ACCS_tbl[Customer]=O2),0))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
M2List=$I$2#
N2List=$J$2#
O2List=$K$2#
 
Upvote 0
I assumed that the data provided was not actual data and that there would be much more variety of values for each level.
 
Upvote 0
I'm afraid these are all too complicated for. I used the word dynamic but perhaps in the wrong context.
What I want to do is have a report created:
1. I select an Area from a drop down menu (I am able to create a list for data validation), say in cell A1
2. the name of this Area will then populate cells, say, A5..A(5+x) (x=see below)
3. the names of the Counties in this area will then populate cells B5..B(5+x) (where x is the number of Counties in that Area (between 1 and 20?)
4. I can then set up lookups or sums to bring in the revenue, shipping and margin totals from the data sheet
5. customer differentiation not that important right now as a secondary selection level.

i could just set out a report and leave 20 rows of a gap between header and total row but that may look untidy if only 1 or 2 Counties in that area.

Thanks anyway, been interesting exploring these formulae.
 
Upvote 0

Forum statistics

Threads
1,214,559
Messages
6,120,194
Members
448,951
Latest member
jennlynn

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