Dependent dropdownlist on Excel table with subheaders

BURTPRI

New Member
Joined
May 8, 2020
Messages
16
Office Version
  1. 2010
Platform
  1. Windows
Hello everybody! This is my first time posting a thread and I really hope someone here can help me quick enough.
I have the following "table" (in quotes bc I couldn't format as an actual Excel table) that brings 3 identical subheaders categories (ADDRESS, EMPLOYEES and EMPLOEMAILS) to each header (the Company).
I need to create three cells with dropdown lists for each subheader category based on the main dropdown list where the user chooses the Company.
Please note that Row 1 brings the headers, Row 2 the subheaders and Raws 3 and 4 the data collected.
I hope I was able to express my challenge well.
Thank you very much if you read this far.

Untitled.jpg
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Book1
ABCDEFGHIJKLMN
1
2Company 1Company 2Company 1
3AddressEmployeesEmployees MailAddressEmployeesEmployees MailCompany 2
4qqEmployees 1Employeesmail 1aaComp2aemployeesmail2a
5asdEmployees 2Employeesmail 2bbComp2bemployeesmail2b
6
7
8CompanyCompany 2
9Addressaa
10EmployeesComp2a
11Employees Mailemployeesmail2a
12
13
14
15
16
17
18
19
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:A142Expression=AND(A3="P",M3>=69,M3<=82,O3=5)textNO
A2Expression=AND(A2="P",M2>=69,M2<=82,O2=5)textNO
Cells with Data Validation
CellAllowCriteria
E8List=$M$2:$M$3
E9List=IF(E8="Company 1",Add_Comp1,Address_Com2)
E10List=IF(E8="Company 1",Emp_Name_1,Empl_Com2)
E11List=IF(E8="Company 1",Mail_Comp1,Mail_Com2)
 
Upvote 0
Please dont copy the Cell with Conditional Formatting..
However i have few issue in the structure.
 
Upvote 0
Another atempt.

It uses dynamic ranges, but I will make your worksheet more flexible. You just need to add another Company with the same column structure and that's all. No changes to DV needed. Well. At least to Address, Employees and Emploemail DVs. :)

Zeszyt1.xlsx
ABCDEF
1Company1Company2
2AddressEmployeesEmploemailsAddressEmployeesEmploemails
3Address1Employees1Emploemails1Address3Employees3Emploemails3
4Address2Employees2Emploemails2Address4Employees4Emploemails4
5
6CompanyCompany1
7Address
8Employees
9Emploemail
Arkusz1
Cells with Data Validation
CellAllowCriteria
B6ListCompany1;Company2
B7List=OFFSET(INDIRECT(ADDRESS(3;MATCH(B6;A1:F1;0);1));0;0;2;1)
B8List=OFFSET(INDIRECT(ADDRESS(3;MATCH(B6;A1:F1;0);1));0;1;2;1)
B9List=OFFSET(INDIRECT(ADDRESS(3;MATCH(B6;A1:F1;0);1));0;2;2;1)
 
Upvote 0
Hi, @CA_Punit
Hmmm strange. It is returning values in my worksheet...

1588949422115.png
1588949448104.png


P.s. If there are to be more companies, then MATCH formula should have bigger range to check.

P.s.2: Question is if Company1 and Company2 are in the first cell of the range? In this case in A1 and D1? I assumed there is the same data structure for all companies.
 
Upvote 0
Hi @nardagus thank you very very much for your answer I really appreciate. I forgot to mention tho that there will be other companies added to this table as well... Probably more 20 companies... So in this case how should I use the MATCH formula?
 
Upvote 0
Cross posted Dependent dropdown list with subheader categories

While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Hi @BURTPRI

No problem. Glad to help.

Well I see two things that need to be done/clarify.

You want around 20 companies. I was also thinking that there might be different number of employees and their email addresses across all companies. Am I right?

Ok. So there are two solutions for that

1) Less flexible, but more simple formula (which leads to easier debugging)
2) More flexible, but bigger and more complex formula

First solution assumes that there will be some max or less number of employees. You will assume that the biggest company will have a 100 employees. This will be max range used for all dropdown entries (In other words it will display values from a range of 100 cells). This however has one flaw. It will render empty entries in dropdown:
1588956955461.png


Second solution can also assume that the biggest company is a 100 employees large, but it will analyze this range and display only non empty cells:
1588957393492.png


So this how my data looks like now:

Zeszyt1.xlsx
ABCDEFGH
1Company1Company2
2AddressEmployeesEmploemailsAddressEmployeesEmploemails
3Address1Employees1Emploemails1Address3Employees3Emploemails3
4Address2Employees2Emploemails2Address4Employees4Emploemails4
5
6CompanyCompany1
7AddressAddress1
8EmployeesEmployees1
9EmploemailEmploemails1
Arkusz1


Address DV formula:
1st solution:
=OFFSET(INDIRECT(ADDRESS(3;MATCH(B6;A1:BR1;0);1));0;0;100;1)
Number 100 here assumes a 100 of employees across all companies.
MATCH(B6;C1:BR1;0) includes a range C1 to BR1 where you will place companies data. If there will be more companies you just need to change the range.

2nd solution
=OFFSET(INDIRECT(ADDRESS(3;MATCH(B6;C1:BR1;0);1));0;0;COUNTA(INDIRECT(ADDRESS(3;MATCH(B6;C1:BR1;0);1)&":"&ADDRESS(100;MATCH(B6;C1:BR1;0);1)));1)

Here all you need to do is to change range C1:BR1 should there be more companies.

Also remember two things:

1) Cell B6 is the one where DV fomulas check which company was chosen. If you move Company somewhere else you need to change it to a new cell address
2) Cells with DV must not be in a range of employees. So if there are 100 employees (so range C3 to C103) you must place DV in C104. Or event better. Place them in different column. Not containing company data. Otherwise you will have circular references error and DV won't work

I hope I explained it clearly.
 
Upvote 0
WOW once again thank you very very much for your patience and yes, it was very clear!

Im embarrassed to say that but... I have my data exactly like yours, my reference Company is in cell B6 as you said, but I'm trying to insert the formulas on the 'Source' field of Data Validation dialog box and it says there's a problem with the formula. I tried to put both formulas also in regular cells as well just in case and still says there's a problem with the formula. Any idea of what am I doing wrong...?
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,205
Members
452,618
Latest member
Tam84

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