Data Validation ( no blanks) based on a dependant cell

nobbyclarke

New Member
Joined
Nov 25, 2015
Messages
24
HELP

Ok so I want to be able to select in cell; A1 either a tool or a task (fixed data) using a drop down list.

Once I select what I want in cell A1; I want Cell B1 to have a drop down list that refers to a list of either tools or a list of tasks depending what is selected in cell A1.

In the list of tools I have 300 cells about 75 of them have a tool in there (eg. Drill - Makita - GMW1324 - (SN#4321))

in the list of tasks I have 300 cells; about 120 of them have tasks in there (eg. Cleaning carpet or washing walls)

here's the glitch...

because there are 300 line entries for each list (tool and tasks) I keep coming up with a data validation drop down box which is mostly full of white space and you have to scroll all the way to the top to get what tool or task you want (dependant on what you select in A1) .

Someone please help me here
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Here's an option:

Excel 2010
ABCDEFG
1TaskToolToolsTasksMeasure
2TaskHammerMeasureCut
31Install
45ScrewdriverDocument
5WrenchCutClean-up
6Install
7DrillDocument
8Sander
9Clean-up
10Saw

<tbody>
</tbody>
Sheet9

Worksheet Formulas
CellFormula
D3=IF(A1="Tool",0,1)
D4=COUNTIF(OFFSET(E2,0,$D$3,300,1),"<>")

<tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
G1{=IFERROR(INDEX(OFFSET($E$1,0,$D$3,300),SMALL(IF(OFFSET($E$1,1,$D$3,300)<>"",ROW($E$2:$E$300),9E+99),ROW()-ROW($G$1)+1)),"")}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



Obviously you can put these pieces in different places, but this example shows how it can work. D1:D2 is the data validation list for A1. D3 is just a formula returning a 0 if Tool is selected, and 1 if Task is selected. D4 is a formula counting how many items are in the selected column. This example shows Task being selected, so there are 5 tasks in column F.

The formula in G1 looks at the selected column (E or F) and removes empty rows. Put the formula in G1, confirm it with Control-Shift-Enter. Then select cell G1 and paste it down the column.

Finally, click on cell B1, then Data Validation from the Data tab, select List and give it a source of
=OFFSET(Sheet9!$G$1,0,0,Sheet9!$D$4)

I'm testing on Sheet9, adapt as needed.

That should do it!

Let me know how it works.
 
Last edited:
Upvote 0
you superstar it worked thankyou very much for your help.

Stilla newby to proper playing in excel but I am learning slowly.

thank you once again
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

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