Data Validation & Dependent Dropdown list

Schturman

New Member
Joined
May 28, 2022
Messages
46
Office Version
  1. 2019
Platform
  1. Windows
Hi to all
I read here a few post about Dependent Dropdown list, but still confused and can't get correct solution.
In Sheet2 I have a all data. In the cell E2 I use unique formula to get the names of companies:
Code:
=UNIQUE(Table7[Company])
In the cell F2 I use filer formula to get the names of all products:
Code:
=UNIQUE(Table7[Product])
In the cell H2 I use filer & unique formula (just for test) to get the names of products related to cell B2 in the Sheet1:
Code:
=UNIQUE(FILTER(Table7[Product],Table7[Company]=Sheet1!$B3))

In the Sheet1 - in the cell B2 I use list and I copied this cell till B7:
Code:
=Sheet2!$E$2#

Now is the problem... I can't directly use Filter or Unique formula inside Data validation and for now I used in the cell C2 this formula for list and I copied this cell till C7:
Code:
=Sheet2!$F$2#
It give me All products in the list and I want only related to the name of Company in a cells B2:B7 in the Sheet1
If I use H2 from Sheet2 in data validation, it stay related only to B3 even if I drag it down

How I can get correct dropdown lists in cells C2:C7 in Sheet1 ?
Thanks
1682763711332.png
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Use named ranges on your spills. and then =INDIRECT("NamedRange") for the DV List
 
Upvote 0
This seems to work . . .

Book1
ABCDEF
1XLOOKUP Double formula
2GroupCompanyProductPriceQuantityTotal
3TablesBarkanTable 130260
4DeliverySalomonHandles 115115
5GlassSalomonTable 255155
6HandlesJonesPlates 149298
7PlatesBurtonGlass 225375
Sheet1
Cell Formulas
RangeFormula
F3:F7F3=E3*D3
Cells with Data Validation
CellAllowCriteria
B3:B7List=INDIRECT(B$2&"List")
C3:C7List=OFFSET(Sheet2!$M$2,1,MATCH(OFFSET($C3,0,-1),Sheet2!$M$2:$P$2,0)-1,COUNTA(OFFSET(Sheet2!$M$2,1,MATCH(OFFSET($C3,0,-1),Sheet2!$M$2:$P$2,0)-1,15))-COUNTIFS(OFFSET(Sheet2!$M$2,1,MATCH(OFFSET($C3,0,-1),Sheet2!$M$2:$P$2,0)-1,15),""),1)


Cell Formulas
RangeFormula
M2:P2M2=IF(ISBLANK(INDIRECT("$E"&COLUMN(M$2)-11)),"",INDIRECT("$E"&COLUMN(M$2)-11))
M3:M7M3=IF(ROWS($L$2:L2)<=COUNTIF(Table7[Company],M$2),INDEX(Table7[Product],AGGREGATE(15,3,(Table7[Company]=M$2)/(Table7[Company]=M$2)*(ROW(Table7[Company])-ROW(Table7[#Headers])),ROWS($L$2:L2))),"")
N3:N7N3=IF(ROWS($L$2:L2)<=COUNTIF(Table7[Company],N$2),INDEX(Table7[Product],AGGREGATE(15,3,(Table7[Company]=N$2)/(Table7[Company]=N$2)*(ROW(Table7[Company])-ROW(Table7[#Headers])),ROWS($L$2:L2))),"")
O3:O7O3=IF(ROWS($L$2:L2)<=COUNTIF(Table7[Company],O$2),INDEX(Table7[Product],AGGREGATE(15,3,(Table7[Company]=O$2)/(Table7[Company]=O$2)*(ROW(Table7[Company])-ROW(Table7[#Headers])),ROWS($L$2:L2))),"")
P3:P7P3=IF(ROWS($L$2:L2)<=COUNTIF(Table7[Company],P$2),INDEX(Table7[Product],AGGREGATE(15,3,(Table7[Company]=P$2)/(Table7[Company]=P$2)*(ROW(Table7[Company])-ROW(Table7[#Headers])),ROWS($L$2:L2))),"")
Named Ranges
NameRefers ToCells
Companies=Sheet2!$M$2:$P$2M2:M7


Cell formulas for products will copy down fine.
Might have been better to use cell refs in place of table ones . . .
 
Upvote 1
Forgot this one Named Range:

Named Ranges
NameRefers ToCells
CompanyList=Sheet2!$E$2:$E$5M2:M7
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,429
Members
448,961
Latest member
nzskater

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