Dependent drop down lists – Enable/Disable selection filter
I have this working right now with 6 drop downs/lists. I wanted to see if you possibly know of a way to see additional information in drop down #4 if there are no selections in drop down #2 and #3. Currently, I have hemisphere in drop down 1, Sector in drop down 2, Region in drop down 3, and Area is drop down 4. If I select a value in drop down #1 (Hemisphere), I would like to see what areas I can filter on in drop down #4 without having to select values in drop down 2 and 3. Is there a way to make that work?
Answer:
Yes, I have simplified my answer to three drop down lists. I recommend downloading the attached excel file before reading this post.
Setup and create first drop down list
Create a dynamic named range
- Click "Formulas" tab
- Click "Name Manager"
- Click "New..."
- Type a name. I named it "order". (See attached file at the end of this post)
- Type =OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A$2:$A$1000)) in "Refers to:" field.
- Click "Close" button
Create a unique distinct list from column A, Sheet1
- Select Sheet2
- Select cell A3. (Cell A2 is empty)
- Type =INDEX(order,MATCH(0,COUNTIF($A$1:B2,order),0)) + CTRL + SHIFT + ENTER. This is an array formula!!
- Copy cell A3 and paste it down as far as needed.
Sheet 2
Create a dynamic named range to get unique distinct list
- Select Sheet2
- Click "Formulas" tab
- Click "Name Manager"
- Click "New..."
- Type a name. I named it "uniqueorder".
- Type =OFFSET(Sheet2!$A$2, 0, 0, COUNT(IF(Sheet2!$A$3:$A$1000="", "", 1))+1, 1) in "Refers to:" field.
- Click "Close" button
Create drop down list
- Select Sheet1
- Select cell E2
- Click Data tab
- Click Data validation button
- Click "Data validation..."
- Select List in the "Allow:" window.
- Type =uniqueorder in the "Source:" window
- Click OK!
Setup and create second dependent drop down list
Create a dynamic named range
- Select sheet1
- Click "Formulas" tab
- Click "Name Manager"
- Click "New..."
- Type a name. I named it "product". (See attached file at the end of this post)
- Type =OFFSET(Sheet1!$B$2,0,0,COUNTA(Sheet1!$B$2:$B$1000)) in "Refers to:" field.
- Click "Close" button
Create a unique distinct list from column B, sheet1.
- Select Sheet2
- Select cell B3. (Cell B2 is empty.)
- Type =INDEX(product, MATCH(0, COUNTIF($B$1:B2, product)+IF(Sheet1!$E$2<>0, order<>Sheet1!$E$2, order=""), 0)) + CTRL + SHIFT + ENTER. This is an array formula!!
- Copy cell B3 and paste it down as far as needed.
Sheet2
Create a dynamic named range to get unique distinct list
- Select Sheet2
- Click "Formulas" tab
- Click "Name Manager"
- Click "New..."
- Type a name. I named it "uniqueproduct".
- Type =OFFSET(Sheet2!$B$2, 0, 0, COUNT(IF(Sheet2!$B$3:$B$1000="", "", 1))+1, 1) in "Refers to:" field.
- Click "Close" button
Create drop down list
- Select Sheet1
- Select cell E5
- Click Data tab
- Click Data validation button
- Click "Data validation..."
- Select List in the "Allow:" window.
- Type =uniqueproduct in the "Source:" window
- Click OK!
Setup and create third dependent drop down list
Create a dynamic named range
- Select sheet1
- Click "Formulas" tab
- Click "Name Manager"
- Click "New..."
- Type a name. I named it "continent".
- Type =OFFSET(Sheet1!$C$2, 0, 0, COUNTA(Sheet1!$C$2:$C$1000))in "Refers to:" field.
- Click "Close" button
Create a unique distinct list from column C, Sheet1
- Select Sheet2
- Select cell C3. (Cell C2 is empty)
- Type =INDEX(continent, MATCH(0, COUNTIF($C$1:C1, continent)+(Sheet1!$E$2<>0)*(order<>Sheet1!$E$2)+(Sheet1!$E$5<>0)*(product<>Sheet1!$E$5), 0)) + CTRL + SHIFT + ENTER. This is an array formula!!
- Copy cell C3 and paste it down as far as needed.
Sheet 2
Create a dynamic named range to get unique distinct list
- Select Sheet2
- Click "Formulas" tab
- Click "Name Manager"
- Click "New..."
- Type a name. I named it "uniquecontinent".
- Type =OFFSET(Sheet2!$C$2, 0, 0, COUNT(IF(Sheet2!$C$2:$C$1000="", "", 1)), 1) in "Refers to:" field.
- Click "Close" button
Create drop down list
- Select Sheet1
- Select cell E8
- Click Data tab
- Click Data validation button
- Click "Data validation..."
- Select List in the "Allow:" window.
- Type =uniquecontinent in the "Source:" window
- Click OK!
Example picture sheet1, first drop down list is blank and second drop down list contains all unique values.
Download example workbook
dependent drop down lists - selection filter.xls
(Excel 97-2003 Workbook *.xls)
Functions in this article:
IF(logical_test;[value_if:true];[value_if_false])
Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE
INDEX(array,row_num,[column_num])
Returns a value or reference of the cell at the intersection of a particular row and column, in a given range
COUNT(value1;[value2])
Counts the number of cells in a range that contain numbers
OFFSET(reference,rows,cols, [height],[width])
Returns a reference to a range that is a given number of rows and columns from a given reference
MATCH(lookup_value;lookup_array; [match_type])
Returns the relative position of an item in an array that matches a specified value
COUNTIF(range,criteria)
Counts the number of cells within a range that meet the given condition
COUNTA(value1,[value2],)
Counts the number of cells in a range that are not empty
Related posts:
Create dependent drop down lists containing unique distinct values in excel
Invoice template with dependent drop down lists in excel
Create dependent drop down lists containing unique distinct values in multiple rows
Create a drop down calendar in excel
Create a drop down list containing alphabetically sorted values in excel






















Outstanding, this works beautifully. Thanks for sharing your expertise.
Hello,
Great work so far but I was wondering if it could do something else...?
If I start off with all the down lists as empty and then, say, select keyboard as the product it successfully shows only US and Europe as the options - but shows both order ID, when it can only come from 1020.
Is it possible for the list to work both ways? Also, what if you were to select Asia and Graphics card - could it automatically fill in 1020 (the auto filling is more of a nice feature than necessary..:))
Any help or advice would be greatly appreciated, thanks!
Charlie,
Question 1:
Download example file
dependent-drop-down-lists-selection-filter_charlie.xls
Question 2:
I think autofilling is possible with combo boxes:
Apply dependent combo box selections to a filter in excel 2007
Thanks very much!!!
How can additional colums with more criteria be added to the exsisting three columns? Can drop boxes be added to multiple rows, such as in an Invoice? I seen your example "Create dependent drop down lists containing unique distict values in multiple rows" but how can those formulas be combined with the formulas in this example?
Can a fourth and five column be added?
Hi Oscar,
Thanks for the great work you are doing.
I am not an expert, and I was wondering if there is any way that you can do and publish the same for 7 columns.
Also, is the excel addin that you have created available to be downloaded for free somewhere?
Thanks a lot for answering my question.
Nilhan