Home > Validation > Drop Downs > Hide Used Items Hide Used Items in Drop Down ListLimit the choices in a Microsoft Excel drop down list, by hiding items that have been previously selected. Several examples of how to use this technique, and workbooks to download. |
Introduction - Hide Used ItemsYou can limit the choices in a drop down list, hiding items that have been previously selected. For example, if you are assigning employees to a shift, you don't want to assign the same employee twice. In the drop down list shown below, Fred and Joe have been assigned, so their names aren't in the list now. There are two sets of instructions on this page: -- 1) All versions - functions available in any version of Excel -- 2) Excel 365- formula uses new functions - SORT and FILTER Thanks to Peo Sjoblom, who contributed the original formula for this technique, and to Daniel.M, who suggested the enhanced formulas. |
1) All Versions - Hide Used ItemsThis technique used functions that are available in all versions of Excel. --A) Set up Main Table --B) Create List of Items --C) Calculate if name is used --D) Create list of unused names --E) Name List of Unused Names --F) Add Drop Down Lists --G) Test Drop Down Lists |
Option 1: Multi-Cell Formula
3. Press Ctrl+Shift+Enter to enter the array formula in cells C1:C6 Option 2: Single-Cell FormulaIf you'd prefer a single-cell formula (easier to edit), you could use this formula, also by Daniel.M. He recommends it for small ranges (<=200 cells):
|
E) Name List of Unused NamesNext, you'll create a named range, using the OFFSET function. Only the cells with names will be included, not the blank cells at the end of the list.
The OFFSET formula creates a range that starts in cell C1. The number of rows in the range is based on the count of numbers in cells B1:B6. Tip: To see the defined names later, go to the Formulas tab ont the Ribbon, and click the Name Manager command |
2) Excel 365 - Hide Used Items - Dynamic ArraysIf your version of Excel has Dynamic Arrays, with the FILTER and SORT functions, use these instructions -- the setup is much simpler than the technique shown above..
Video 1: Hide Used Items - DemoFirst, this 30-second video shows you a quick demo of how this technique works. For the full details, you can see a step-by-step video, and written steps, in the next section, below. |
Video: Hide Used Items - Dynamic ArraysThis video shows the steps for setting up the drop down list that hides the used items. The written instructions are below the video. Video Timeline
|
1) Workbook SetupOn the Schedule sheet, there is a named table - tblSched. The table has 2 columns:
After an employee has been assigned, that name is removed from the drop down list. In the screen shot below, Bert, Mike and Anne are no longer in the list. On the Lists sheet, there is a named table - tblEmp. The table has 1 column - EmpList. Employee names are typed in that column. The list is sorted alphabetically, but does not need to be sorted. |
2) Available Employees ListAlso on the Lists sheet, there is a dynamic array, starting in cell D2. The formula uses the new Excel functions, SORT and FILTER, combined with COUNTIF, to create a list of employees who have not been assigned on the Schedule sheet. Here is the formula in cell D2:
The FILTER function returns:
Then, the SORT function sorts the names alphabetically, for convenience when using the drop down list. Note: Later, if you add a new item in the employee list table, it will automatically be included in the filtered results. |
3) Employee Drop Down ListOn the Schedule sheet, data validation was used to create drop down lists in the Employee column. Those drop down lists are based on the dynamic array of available employee names. In the data validation window settings:
|
Data Validation ErrorsIn the "hide used items" examples, where used items are removed from the list, Excel shows error markers on the cells, if you have that feature turned on. You can ignore those error markers, or use the following technique (for Excel 365 -- uses spill functions (dynamic arrays). Move Used Items to Bottom of ListThis technique moves the used items to the bottom of the drop down list, instead of removing them. That prevents the data validation errors, because all of the items are in the drop down list, and valid. Employee ListIn the Employee list, there are two columns -- employee name, and a formula to calculate if the name has been used. Here is the formula in cell C2:
|
Separator ItemIn the list of employee names, a separator item has been added: zzz-Used
Dynamic Names List for Drop DownThis formula is in cell E2, to create the list of names for the drop downs. =SORTBY(SORT(tblEmp[EmpList]),tblEmp[Used],1) Here's how the formula works:
Drop Down ListOn the Schedule sheet, the drop down lists have this data validation setting:
Click the drop down arrow, to see all the names, with the unused names at the top, and used names at the bottom. For these drop down list cells, all the items are included in the list, so Excel does not mark the cells as errors. |
More Examples - Hide Used ItemsThere are other examples of this Hide Used Items technique. You can download these sample files in the Download section. Baseball PlayersSelect a player for each position, for each of the nine innings of a baseball game. After you choose a name in an inning, it disappears from that inning's drop down list. The lists for the other innings are not affected. In the screen shot below, Mike was selected as the pitcher, so his name is not in the drop down list. Players who have been picked for the second inning still show up in the list for the first inning. |
Selections Across a RowIn this example, the layout is different -- selections are made across a row, instead of down a column. In the screen shot below, Cam's name is removed from the lists in Row 2, because he has already been assigned a task for that day. There are two versions of this sample file in the download section below:
|
Get the Workbooks
|
|
Last updated: May 26, 2023 2:57 PM