Google Sheets is a great tool for managing data. However, it can be difficult to create a dependently drop-down list. This article will show you how to create a dependently drop-down list in Google Sheets. First, open Google Sheets and create a new sheet. Name the sheet Dependency List. Next, add the following code to the sheet: #include <stdio.h> #include <string.h> #include <ctype.h> #include <time.h> ///////////////////////////////////////////////////////////////////////////////////////// // Drop-Down List ///////////////////////////////////////////////////////////////////////////////////////// // function prototype void DropDownList(int i, char* name) { // if (!name) { printf("%s not found", name); } else { printf("%s", name); } } ///////////////////////////////////////////////////////////////////////////////////////// // main() function { DropDownList(1,“MyDropDownList”); printf(“The dependency list has %d items.”%, i); } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
By using a drop-down list, you can make data entry more efficient and error-free. You can also create a dependent drop-down list in Google Sheets so that the first list choice determines the options for the second.
Dependent drop-down lists are useful for many situations. You may list products with specific attributes, car makes that have particular models, or websites with certain sections. By creating a drop-down list where the choice controls what appears in the second drop-down list, you can speed up data entry.
Let’s look at how to create a dependent drop-down list in Google Sheets.
RELATED: The Beginner’s Guide to Google Sheets
Set Up the List Items
To get started, enter the list headers and items for each list on a sheet. You can do this in the same sheet where you plan to insert the drop-down lists or another if you want the items out of view.
For this tutorial, we have Entrees and Desserts for our event. If you pick Entree in the drop-down list, you’ll see your choices in the second list. If you pick Dessert in the drop-down list, you’ll see those choices instead.
For the purpose of showing all of the steps involved, we’ll keep everything in the same spreadsheet.
You can also label or decide where you plan to insert the drop-down lists. Here, we’ll be adding those to cells A2 and B2 below the headers.
Name the Ranges
Next, you’ll name the ranges that contain the list items. This is necessary for the dependent drop-down list as you’ll see later.
Select the first list of items without the header, go to Data in the menu, and pick “Named Ranges.”
Enter the name for the range which should be the same as the first list item for the first drop-down list. In our case, we enter “Entree.” Then, click “Done.”
Keep the sidebar open, select the second set of list items, and click “Add a Range.”
Enter the name for the second set of items and here, this would be the second list item you can choose in the drop-down list. For our example, we enter “Dessert” and click “Done.”
Once you have your named ranges, you can close the side panel and create the first drop-down list.
RELATED: How to Create a Drop-Down List in Google Sheets
Create the First Drop-Down List
Select the cell where you want the first drop-down list. For our example, this is cell A2 where you pick either Entree or Dessert. Then, go to Data > Data Validation in the menu.
In the box that appears, move to Criteria. Select “List From a Range” in the drop-down box and then enter the cell range containing the list headers. For our example, this is D3:E3 containing “Entree” and “Dessert.”
Check the box for Show Dropdown List in Cell. Choose what to show for invalid data, optionally include Show Validation Help Text, and click “Save.”
You should then see your first drop-down list in the cell you selected.
Insert the Function
Before you create the dependent drop-down list, you need to insert the INDIRECT function. The results are what you’ll use as the cell range for that second list. Use the cell location for your first drop-down list.
Go to an empty cell in the sheet and enter the following replacing the cell reference with your own:
When you choose an item from the drop-down list, you’ll see the INDIRECT function display the list items. So when we select “Entree” those list items appear and the same happens when we select “Dessert.”
Create the Dependent Drop-Down List
Now it’s time to create the dependent drop-down list. Go to the cell where you want the list and click Data > Data Validation from the menu as you did to create the first list.
RELATED: How to Restrict Data in Google Sheets with Data Validation
In the box that appears, move to Criteria. Select “List From a Range” in the drop-down box and then enter the cell range containing the list items that display from the INDIRECT function.
Check the box for Show Dropdown List in Cell, complete the invalid data and appearance settings per your preference, and click “Save.”
You can then give your lists a test! Select the first list item in the first list and you should see the correct items appear as choices in the second list.
To confirm it all works, select your next list item and confirm the choices in the dependent drop-down list.
You may have many more list items than our example, so when you’re satisfied that the lists work correctly, put them to work!