Data Validation : Drop Down List with a Formula

jbhakta

Board Regular
Joined
Jun 11, 2002
Messages
134
Hi
I wanted to find out which is the efficient way to have a drop down data validation list which changes according to the entry in the table below.
I have tried IF formula but not sure if efficient as a have a lot of conditions.

BrandsNikePumaAdidasVegaGeoxNew BalanceOTHER
******◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦
B5
NikeSKU0001SKU0100SKU0200SKU0300SKU0400SKU0500SKU0600
B6
PumaSKU0002SKU0101SKU0201SKU0301SKU0401SKU0501SKU0601
B7
AdidasSKU0003SKU0102SKU0202SKU0302SKU0402SKU0502SKU0602
B8
VegaSKU0004SKU0103SKU0203SKU0303SKU0403SKU0503SKU0603
B9
GeoxSKU0005SKU0104SKU0204SKU0304SKU0404SKU0504SKU0604
B10
New BalanceSKU0006SKU0105SKU0205SKU0305SKU0405SKU0505SKU0605
B11
OTHERSKU0007SKU0106SKU0206SKU0306SKU0406SKU0506SKU0606
B12
SKU0008SKU0107SKU0207SKU0307SKU0407SKU0507SKU0607
B13
B14

Nike is in Cell B5

I have brands then depending on the Brands selected appropriate drop down table appears in cell C19 (currently selected SKU0601 below)

B16
BrandDepartment
B17
B18
SelectSelect
B19
OTHER
SKU0601
Need Formula in the data validation that would bring the relevant drop down list from above table
C19I tried IF formula but ran out of space and would not let me extend the formula
=IF($B$19=$B$5,$D$5:$D$14,IF($B$19=$B$6,$F$5:$F$14,IF($B$19=$B$7,$H$5:$H$14,IF($B$19=$B$8,$J$5:$J$14,IF($B$19=$B$9,$L$5:$L$14,IF($B$19=$B$10,$N$5:$N$14,IF($B$19=$B$11,$P$5:$P$14)))))))

I have inserted above formula in the Data Validation List Formula but what I am finding on other sheets is that the formula is not accepted in the data validation when I have many brands...
Is there a more efficient way to do this?

Above formula works here but when I have a sheet with twenty brands the formula is too long.

Let me know if anyone has a suggestion...

I have thought of another way using Hlookup but wondered if anyone else knew other ways

Thanks
Jay
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
If you create named ranges for each of your lists you can do it like
+Fluff 1.xlsm
ABCDEFGHIJKLMNOP
1
2
3BrandsNikePumaAdidasVegaGeoxNew BalanceOTHER
4******◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦
5NikeSKU0001SKU0100SKU0200SKU0300SKU0400SKU0500SKU0600
6PumaSKU0002SKU0101SKU0201SKU0301SKU0401SKU0501SKU0601
7AdidasSKU0003SKU0102SKU0202SKU0302SKU0402SKU0502SKU0602
8VegaSKU0004SKU0103SKU0203SKU0303SKU0403SKU0503SKU0603
9GeoxSKU0005SKU0104SKU0204SKU0304SKU0404SKU0504SKU0604
10New BalanceSKU0006SKU0105SKU0205SKU0305SKU0405SKU0505SKU0605
11OTHERSKU0007SKU0106SKU0206SKU0306SKU0406SKU0506SKU0606
12SKU0008SKU0107SKU0207SKU0307SKU0407SKU0507SKU0607
13
14
15
16
17
18
19New BalanceSKU0501
20
Main
Cells with Data Validation
CellAllowCriteria
B19List=Brands
C19List=INDIRECT(SUBSTITUTE(B19," ","_"))
 
Upvote 0
Hi

I dont understand what you mean by =INDIRECT(SUBSTITUTE(B19," ","_"))

Are you able to explain the formula.

Jay
 
Upvote 0
You need to create named ranges called Nike, Puma Etc However for New Balance it needs to be named New_Balance as you cannot have spaces in a named range.
The formula looks at the value in B19 & returns the relevant named range substituting any spaces with an underscore.
 
Upvote 0
@jbhakta
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
My version in 9 years old... Excel 97 _2003

By the way I don't have space... above New Balance was just an example... so do not need the Substitute formula.

How does the INDIRECT formula work? Do I put it in the Data Validation box.

I have never used INDIRECT formula before... I'm reading up on it now but feeling lost.

Do I need to first create a table with Brands and Range name next to it.. so to use in the INDIRECT formula in my Data Validation...

This is my name range table:

BrandsRange Name
NikeNK1
PumaPM1
AdidasAD1
VegaAG1
GeoxGO1

Thanks
Jay
 
Upvote 0
The named ranges need to include the data you want in the drop-down, so in the example from post#2 Brands would be B5:B11, Nike would be D5:D12 etc.
Do I put it in the Data Validation box
Yes, select List & then put the formula in the source box. If all your named ranges are single words then you can use
Excel Formula:
=INDIRECT(B19)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,730
Messages
6,132,387
Members
449,725
Latest member
Enero1

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