Data validation - dynamic and also dependent on a particular column

realdemigod

Board Regular
Joined
Aug 19, 2014
Messages
51
Office Version
  1. 365
Platform
  1. MacOS
Hi,
Please refer to the image in the link below. I’m trying to create a data validation that lets a user choose Product and Colour of a car from the Manufacturer.


Is there way to put some function in data validation list option so that it looks for Audi on the worksheet and takes the Product as the first list and then second data validation show the list of colours again the product types (Q7 and Q5)


For example data validation at A1 should show Q7 and Q5 and then at B1 should show the corresponding colours against each model for Audi. The range could be anywhere in the particular columns but the placements of the columns are fixed. So defining a name would be a challenge.

I can't use any macro. Is it possible with some if or some other function?

HTML:
https://imgur.com/aevnBpg

Thanks
 
My apologies for not being clear enough before. The Audi in the sheet I initially shared starts with row #3 but in the file I have to use, it could be anywhere on any row but the column is fixed. Depending on the output file it could change its position in terms of row placement but the column position is always the same.

So I'm trying to see how to use a row that I know and a value that I can extract to put it in the working column E and then calculate for the rest of the rows. For example if I know Audi is in the column AB (instead of C) and the first instance is row #400 , I want to start the working column E with =COUNTIF($AB400:AB3000, AB400). Same needs to be done for columns F and G.

So I'm looking for a way to use functions to give reference like $C3 not $C$3.
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I haven't read all the posts and I don't know if you didn't want to use matrix formulas.
You can drop those helper columns and use in M3, a matrix formula (use Ctrl + **** + Enter).

=IFERROR(INDEX($B$3:$B$14,SMALL(IF(($C$3:$C$14=$K$3)*($A$3:$A$14=$L$3),ROW($B$3:$B$14)-ROW($B$3) + 1,"");ROWS($M$2:M2)));"")

Then pull the formula down to where it is needed.

$H$3:$H$4$I$3:$I$4 $N$3:$N$6
ProductColourManufacturer ManufacturerProductColors
Q7BlackAudi AudiQ7Black
X3BlackBMW Blue
Q7BlueAudi Red
Q5BlueAudi White
X3BlueBMW
X5BlueBMW
Q7RedAudi
X5RedBMW
Q7WhiteAudi
Q5WhiteAudi
X3WhiteBMW
X5WhiteBMW
<colgroup><col width="77" style="width: 58pt;" span="2"> <col width="99" style="width: 74pt; mso-width-source: userset; mso-width-alt: 2885;"> <col width="26" style="width: 19pt; mso-width-source: userset; mso-width-alt: 744;" span="4"> <col width="77" style="width: 58pt;" span="2"> <col width="31" style="width: 23pt; mso-width-source: userset; mso-width-alt: 907;"> <col width="96" style="width: 72pt; mso-width-source: userset; mso-width-alt: 2792;"> <col width="77" style="width: 58pt;"> <col width="92" style="width: 69pt; mso-width-source: userset; mso-width-alt: 2676;"> <tbody> </tbody>
 
Upvote 0
I haven't read all the posts and I don't know if you didn't want to use matrix formulas.
You can drop those helper columns and use in M3, a matrix formula (use Ctrl + **** + Enter).

=IFERROR(INDEX($B$3:$B$14,SMALL(IF(($C$3:$C$14=$K$3)*($A$3:$A$14=$L$3),ROW($B$3:$B$14)-ROW($B$3) + 1,"");ROWS($M$2:M2)));"")

Then pull the formula down to where it is needed.

$H$3:$H$4$I$3:$I$4$N$3:$N$6
ProductColourManufacturerManufacturerProductColors
Q7BlackAudiAudiQ7Black
X3BlackBMWBlue
Q7BlueAudiRed
Q5BlueAudiWhite
X3BlueBMW
X5BlueBMW
Q7RedAudi
X5RedBMW
Q7WhiteAudi
Q5WhiteAudi
X3WhiteBMW
X5WhiteBMW

<tbody>
</tbody>

Thanks for your help but I don't know where Audi begins on the worksheet and also I need to let a user choose Audi and then the product and then the colour. Is it possible with your formula?
 
Upvote 0
If that Manufacturer data moves like this:

AAABAC
399
400Manufacturer
401Audi
402BMW
403Audi
404Audi
405BMW
406BMW
407Audi
408BMW
409Audi
410Audi
411BMW
412BMW
413

<tbody>
</tbody>
Sheet1

...and can continue down to AB3600 then the formula in column E becomes =COUNTIF($AB401:$AB$3600,AB401)

Don't forget all those columns with formulae must also be copied down 3,200 rows and the Product and Color must also have 3,200 rows of data.

F3 becomes =A3&AB401
G3 becomes =IF(COUNTIF(G:G,1) < ROWS(I$2:I2),"",INDEX(A$3:A$3203,AGGREGATE(15,6,ROW(F$3:F$3203)-ROW(I$2)/(G$3:G$3203=1),ROWS(I$2:I2))))
 
Upvote 0
Thanks for your help but I don't know where Audi begins on the worksheet and also I need to let a user choose Audi and then the product and then the colour. Is it possible with your formula?


Yes.

Choose MANUFACTURER then choose PRODUCT and you will get COLOR for what you choose.

Don't forget (CONTROL + SHIFT + ENTER)
 
Last edited:
Upvote 0
Thanks for your help but I don't know where Audi begins on the worksheet and also I need to let a user choose Audi and then the product and then the colour.

does not matter where Audi begins. Adjust your range.


Is it possible with your formula?


Yes.

Choose MANUFACTURER then choose PRODUCT and you will get COLOR for what you choose.

Don't forget (CONTROL + SHIFT + ENTER)
 
Upvote 0
If that Manufacturer data moves like this:

AAABAC
399
400Manufacturer
401Audi
402BMW
403Audi
404Audi
405BMW
406BMW
407Audi
408BMW
409Audi
410Audi
411BMW
412BMW
413

<tbody>
</tbody>
Sheet1

...and can continue down to AB3600 then the formula in column E becomes =COUNTIF($AB401:$AB$3600,AB401)

Don't forget all those columns with formulae must also be copied down 3,200 rows and the Product and Color must also have 3,200 rows of data.

F3 becomes =A3&AB401
G3 becomes =IF(COUNTIF(G:G,1) < ROWS(I$2:I2),"",INDEX(A$3:A$3203,AGGREGATE(15,6,ROW(F$3:F$3203)-ROW(I$2)/(G$3:G$3203=1),ROWS(I$2:I2))))

Thanks I got that but I can't put the formula manually every time after looking at the worksheet where Audi is starting that is why I thought I could use MATCH function to get the first instance and then use the column AB and the row number returned by MATCH function.

But I don't know how to use a column and a number to use as a reference. I tried different things but not able to achieve.
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,614
Members
449,039
Latest member
Mbone Mathonsi

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