Create a drop-down list
You can help people work more efficiently in worksheets by using drop-down lists in cells. Drop-downs allow people to pick an item from a list that you create.
-
In a new worksheet, type the entries you want to appear in your drop-down list. Ideally, you’ll have your list items in an
Excel table
. If you don’t, then you can quickly convert your list to a table by selecting any cell in the range, and pressing
Ctrl+T
.Notes:
-
Why should you put your data in a table? When your data is in a table, then as you
add or remove items from the list
, any drop-downs you based on that table will automatically update. You don’t need to do anything else. -
Now is a good time to
Sort data in a range or table
in your drop-down list.
-
-
Select the cell in the worksheet where you want the drop-down list.
-
Go to the
Data
tab on the Ribbon, then
Data Validation
.Note:
If you can’t click
Data Validation
, the worksheet might be protected or shared.
Unlock specific areas of a protected workbook
or stop sharing the worksheet, and then try step 3 again. -
On the
Settings
tab, in the
Allow
box, click
List
. -
Click in the
Source
box, then select your list range. We put ours on a sheet called Cities, in range A2:A9. Note that we left out the header row, because we don’t want that to be a selection option: -
If it’s OK for people to leave the cell empty, check the
Ignore blank
box. -
Check the
In-cell dropdown
box. -
Click the
Input Message
tab.-
If you want a message to pop up when the cell is clicked, check the
Show input message when cell is selected
box, and type a title and message in the boxes (up to 225 characters). If you don’t want a message to show up, clear the check box.
-
-
Click the
Error Alert
tab.-
If you want a message to pop up when someone enters something that’s not in your list, check the
Show error alert after invalid data is entered
box, pick an option from the
Style
box, and type a title and message. If you don’t want a message to show up, clear the check box.
-
-
Not sure which option to pick in the
Style
box?-
To show a message that doesn’t stop people from entering data that isn’t in the drop-down list, click
Information
or Warning. Information will show a message with this icon
and Warning will show a message with this icon
. -
To stop people from entering data that isn’t in the drop-down list, click
Stop
.Note:
If you don’t add a title or text, the title defaults to «Microsoft Excel» and the message to: «The value you entered is not valid. A user has restricted values that can be entered into this cell.»
-
You can download an example workbook with multiple data validation examples like the one in this article. You can follow along, or create your own data validation scenarios.
Download Excel data validation examples
.
Data entry is quicker and more accurate when you restrict values in a cell to choices from a drop-down list.
Start by making a list of valid entries on a sheet, and sort or rearrange the entries so that they appear in the order you want. Then you can use the entries as the source for your drop-down list of data. If the list is not large, you can easily refer to it and type the entries directly into the data validation tool.
-
Create a list of valid entries for the drop-down list, typed on a sheet in a single column or row without blank cells.
-
Select the cells that you want to restrict data entry in.
-
On the
Data
tab, under
Tools
, click
Data Validation
or
Validate
.Note:
If the validation command is unavailable, the sheet might be protected or the workbook may be shared. You cannot change data validation settings if your workbook is shared or your sheet is protected. For more information about workbook protection, see
Protect a workbook
. -
Click the
Settings
tab, and then in the
Allow
pop-up menu, click
List
. -
Click in the
Source
box, and then on your sheet, select your list of valid entries.The dialog box minimizes to make the sheet easier to see.
-
Press RETURN or click the
Expand
button to restore the dialog box, and then click
OK
.Tips:
-
You can also type values directly into the
Source
box, separated by a comma. -
To modify the list of valid entries, simply change the values in the source list or edit the range in the
Source
box. -
You can specify your own error message to respond to invalid data inputs. On the
Data
tab, click
Data Validation
or
Validate
, and then click the
Error Alert
tab.
-
See also
Apply data validation to cells
-
In a new worksheet, type the entries you want to appear in your drop-down list. Ideally, you’ll have your list items in an
Excel table
.Notes:
-
Why should you put your data in a table? When your data is in a table, then as you
add or remove items from the list
, any drop-downs you based on that table will automatically update. You don’t need to do anything else. -
Now is a good time to
Sort your data in the order you want it to appear
in your drop-down list.
-
-
Select the cell in the worksheet where you want the drop-down list.
-
Go to the
Data
tab on the Ribbon, then click
Data Validation
. -
On the
Settings
tab, in the
Allow
box, click
List
. -
If you already made a table with the drop-down entries, click in the
Source
box, and then click and drag the cells that contain those entries. However, do not include the header cell. Just include the cells that should appear in the drop-down. You can also just type a list of entries in the
Source
box, separated by a comma like this:
Fruit,Vegetables,Grains,Dairy,Snacks
-
If it’s OK for people to leave the cell empty, check the
Ignore blank
box. -
Check the
In-cell dropdown
box. -
Click the
Input Message
tab.-
If you want a message to pop up when the cell is clicked, check the
Show message
checkbox, and type a title and message in the boxes (up to 225 characters). If you don’t want a message to show up, clear the check box.
-
-
Click the
Error Alert
tab.-
If you want a message to pop up when someone enters something that’s not in your list, check the
Show Alert
checkbox, pick an option in
Type
, and type a title and message. If you don’t want a message to show up, clear the check box.
-
-
Click
OK
.
After you create your drop-down list, make sure it works the way you want. For example, you might want to check to see if
Change the column width and row height
to show all your entries. If you decide you want to change the options in your drop-down list, see
Add or remove items from a drop-down list
. To delete a drop-down list, see
Remove a drop-down list
.
Need more help?
You can always ask an expert in the Excel Tech Community or get support in the Answers community.
See also
Add or remove items from a drop-down list
Video: Create and manage drop-down lists
Overview of Excel tables
Apply data validation to cells
Lock or unlock specific areas of a protected worksheet
Need more help?
Data entry is quicker and more accurate when you use a drop-down list to limit the entries people can make in a cell. When someone selects a cell, the drop-down list’s down-arrow appears, and they can click it and make a selection.
Create a drop-down list
You can make a worksheet more efficient by providing drop-down lists. Someone using your worksheet clicks an arrow, and then clicks an entry in the list.
-
Select the cells that you want to contain the lists.
-
On the ribbon, click DATA > Data Validation.
-
In the dialog, set Allow to List.
-
Click in Source, type the text or numbers (separated by commas, for a comma-delimited list) that you want in your drop-down list, and click OK.
Want more?
Create a drop-down list
Add or remove items from a drop-down list
Remove a drop-down list
Lock cells to protect them
Data entry is quicker and more accurate when you use a drop-down list to limit the entries that people can make in a cell.
When you select a cell, the drop-down list’s down-arrow appears, click it, and make a selection.
Here is how to create drop-down lists: Select the cells that you want to contain the lists.
On the ribbon, click the DATA tab, and click Data Validation.
In the dialog, set Allow to List.
Click in Source.
In this example, we are using a comma-delimited list.
The text or numbers we type in the Source field are separated by commas.
And click OK. The cells now have a drop-down list.
Up next, Drop-down list settings.
Need more help?
Содержание
- 0.1 Простейший способ
- 0.1.1 Excel
- 0.1.2 Calc
- 0.2 Простейший способ
- 0.2.1 Excel
- 0.2.2 Calc
- 0.3 Мудрейший способ
- 0.3.1 Excel
- 0.3.2 Calc
- 0.3.3 Кстати
- 1 , но можно и «неформально» обрамить его тэгом — и покажи мне разницу…«, но имеет место бывать. Выделите ячейки с данными, которые должны попасть в выпадающий список (например, наименованиями товаров). Выберите в меню Вставка — Имя — Присвоить (Insert — Name — Define) и введите имя (можно любое, но обязательно без пробелов!) для выделенного диапазона (например Товары). Нажмите ОК. Можно сделать и так: Выделить диапазон ячеек (А1, В1, С1 в данном примере), и претворить его в «реальный» список В любом случае списку должно быть присвоено уникальное имя. Выделите ячейки (можно сразу несколько), в которых хотите получить выпадающий список и выберите в меню «Данные — Проверка» (Data — Validation). На первой вкладке «Параметры» из выпадающего списка «Тип данных» выберите вариант «Список» и введите в строчку «Источник» знак равно и имя диапазона (т.е. =Товары). Почему это круто: список «Товары» можно будет потом произвольно увеличивать или уменьшать. Табличный редактор будет учитывать не определенные ячейки, расположенные в определенном месте, а список as is. И все изменения в списке будут распространяться на все ячейки, которые «проверяют его для создания выпадающих списков». Горячие клавиши Курсор стоит на ячейке с выпадающим списком. Excel Alt+Down arrow. То есть, Alt+стрелка «вниз». Calc По-умолчанию не установлено. В справке написано Ctrl+D, но в справке баг (увы). Поэтому назначаем лично: Tools > Customize > Keyboard > Shortcut Keys Проскроллить и выбрать желаемое сочетание клавиш для открытия существующего списка. Я выбрал Ctrl+Down. Внимание, Alt+Down недоступно (вообще все сочетания с Alt тут недоступны для редактирования). В Functions > Category выбрать Edit. В Functions > Function выбрать Selection List. Нажать на кнопку Modify. Дополнение Всякие другие волшебства на тему выпадающих списков см. на Planeta Excel. Особенно «Ссылки по теме«. Прием комментариев к этой записи завершён. «Как зделать так чбо если в віпадающем списке нет нужного варианта я в ручную набираю в етой ячейке и оно автоматически добавляется в віпадающий список, и след раз уже там есть» — хз. Тут нам не то, и не это. Не надо задавать вопросы о том, как сделать ещё что-то с этими прекрасными выпадающими списками. Здесь даже не форум по Excel. Это блог о тестировании программного обеспечения. Вы же любите тестировать, правда?
Create a Drop-down List | Tips and Tricks Drop-down lists in Excel are helpful if you want to be sure that users select an item from a list, instead of typing their own values. Create a Drop-down List To create a drop-down list in Excel, execute the following steps. 1. On the second sheet, type the items you want to appear in the drop-down list. 2. On the first sheet, select cell B1. 3. On the Data tab, in the Data Tools group, click Data Validation. The ‘Data Validation’ dialog box appears. 4. In the Allow box, click List. 5. Click in the Source box and select the range A1:A3 on Sheet2. 6. Click OK. Result: Note: if you don’t want users to access the items on Sheet2, you can hide Sheet2. To achieve this, right click on the sheet tab of Sheet2 and click on Hide. Tips and Tricks Below you can find a few tips and tricks when creating drop-down lists in Excel. 1. You can also type the items directly into the Source box, instead of using a range reference. Note: this makes your drop-down list case sensitive. For example, if a user types pizza, an error alert will be displayed. 2a. If you type a value that is not in the list, Excel shows an error alert. 2b. To allow other entries, on the Error Alert tab, uncheck ‘Show error alert after invalid data is entered’. 3. To automatically update the drop-down-list, when you add an item to the list on Sheet2, use the following formula: =OFFSET(Sheet2!$A$1,0,0,COUNTA(Sheet2!$A:$A),1) Explanation: the OFFSET function takes 5 arguments. Reference: Sheet2!$A$1, rows to offset: 0, columns to offset: 0, height: COUNTA(Sheet2!$A:$A), width: 1. COUNTA(Sheet2!$A:$A) counts the number of values in column A on Sheet2 that are not empty. When you add an item to the list on Sheet2, COUNTA(Sheet2!$A:$A) increases. As a result, the range returned by the OFFSET function expands and the drop-down list will be updated. 4. Do you want to take your Excel skills to the next level? Learn how to create dependent drop-down lists in Excel.
A drop-down list is an excellent way to give the user an option to select from a pre-defined list. It can be used while getting a user to fill a form, or while creating interactive Excel dashboards. Drop-down lists are quite common on websites/apps and are very intuitive for the user. Watch Video – Creating a Drop Down List in Excel In this tutorial, you’ll learn how to create a drop down list in Excel (it takes only a few seconds to do this) along with all the awesome stuff you can do with it. How to Create a Drop Down List in Excel In this section, you will learn the exacts steps to create an Excel drop-down list: Using Data from Cells. Entering Data Manually. Using the OFFSET formula. #1 Using Data from Cells Let’s say you have a list of items as shown below: Here are the steps to create an Excel Drop Down List: Select a cell where you want to create the drop down list. Go to Data –> Data Tools –> Data Validation. In the Data Validation dialogue box, within the Settings tab, select List as the Validation criteria. As soon as you select List, the source field appears. In the source field, enter =$A$2:$A$6, or simply click in the Source field and select the cells using the mouse and click OK. This will insert a drop down list in cell C2. Make sure that the In-cell dropdown option is checked (which is checked by default). If this option in unchecked, the cell does not show a drop down, however, you can manually enter the values in the list. Note: If you want to create drop down lists in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. Make sure that the cell references are absolute (such as $A$2) and not relative (such as A2, or A$2, or $A2). #2 By Entering Data Manually In the above example, cell references are used in the Source field. You can also add items directly by entering it manually in the source field. For example, let’s say you want to show two options, Yes and No, in the drop down in a cell. Here is how you can directly enter it in the data validation source field: This will create a drop-down list in the selected cell. All the items listed in the source field, separated by a comma, are listed in different lines in the drop down menu. All the items entered in the source field, separated by a comma, are displayed in different lines in the drop down list. Note: If you want to create drop down lists in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. #3 Using Excel Formulas Apart from selecting from cells and entering data manually, you can also use a formula in the source field to create an Excel drop down list. Any formula that returns a list of values can be used to create a drop-down list in Excel. For example, suppose you have the data set as shown below: Here are the steps to create an Excel drop down list using the OFFSET function: This will create a drop-down list that lists all the fruit names (as shown below). Note: If you want to create a drop-down list in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. Make sure that the cell references are absolute (such as $A$2) and not relative (such as A2, or A$2, or $A2). How this formula Works?? In the above case, we used an OFFSET function to create the drop down list. It returns a list of items from the ra It returns a list of items from the range A2:A6. Here is the syntax of the OFFSET function: =OFFSET(reference, rows, cols, , ) It takes five arguments, where we specified the reference as A2 (the starting point of the list). Rows/Cols are specified as 0 as we don’t want to offset the reference cell. Height is specified as 5 as there are five elements in the list. Now, when you use this formula, it returns an array that has the list of the five fruits in A2:A6. Note that if you enter the formula in a cell, select it and press F9, you would see that it returns an array of the fruit names. Creating a Dynamic Drop Down List in Excel (Using OFFSET) The above technique of using a formula to create a drop down list can be extended to create a dynamic drop down list as well. If you use the OFFSET function, as shown above, even if you add more items to the list, the drop down would not update automatically. You will have to manually update it each time you change the list. Here is a way to make it dynamic (and it’s nothing but a minor tweak in the formula): Select a cell where you want to create the drop down list (cell C2 in this example). Go to Data –> Data Tools –> Data Validation. In the Data Validation dialogue box, within the Settings tab, select List as the Validation criteria. As soon as you select List, the source field appears. In the source field, enter the following formula: =OFFSET($A$2,0,0,COUNTIF($A$2:$A$100,””)) Make sure that the In-cell drop down option is checked. Click OK. In this formula, I have replaced the argument 5 with COUNTIF($A$2:$A$100,””). The COUNTIF function counts the non-blank cells in the range A2:A100. Hence, the OFFSET function adjusts itself to include all the non-blank cells. Note: For this to work, there must NOT be any blank cells in between the cells that are filled. If you want to create a drop-down list in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. Make sure that the cell references are absolute (such as $A$2) and not relative (such as A2, or A$2, or $A2). Copy Pasting Drop-Down Lists in Excel You can copy paste the cells with data validation to other cells, and it will copy the data validation as well. For example, if you have a drop-down list in cell C2, and you want to apply it to C3:C6 as well, simply copy the cell C2 and paste it in C3:C6. This will copy the drop-down list and make it available in C3:C6 (along with the drop down, it will also copy the formatting). If you only want to copy the drop down and not the formatting, here are the steps: This will only copy the drop down and not the formatting of the copied cell. Caution while Working with Excel Drop Down List You need to to be careful when you are working with drop down lists in Excel. When you copy a cell (that does not contain a drop down list) over a cell that contains a drop down list, the drop down list is lost. The worst part of this is that Excel will not show any alert or prompt to let the user know that a drop down will be overwritten. How to Select All Cells that have a Drop Down List in it Sometimes, it ‘s hard to know which cells contain the drop down list. Hence, it makes sense to mark these cells by either giving it a distinct border or a background color. Instead of manually checking all the cells, there is a quick way to select all the cells that have drop-down lists (or any data validation rule) in it. This would instantly select all the cells that have a data validation rule applied to it (this includes drop down lists as well). Now you can simply format the cells (give a border or a background color) so that visually visible and you don’t accidentally copy another cell on it. Here is another technique by Jon Acampora you can use to always keep the drop down arrow icon visible. You can also see some ways to do this in this video by Mr. Excel. Creating a Dependent / Conditional Excel Drop Down List Here is a video on how to create a dependent drop-down list in Excel. If you prefer reading over watching a video, keep reading. Sometimes, you may have more than one drop-down list and you want the items displayed in the second drop down to be dependent on what the user selected in the first drop-down. These are called dependent or conditional drop down lists. Below is an example of a conditional/dependent drop down list: In the above example, when the items listed in ‘Drop Down 2’ are dependent on the selection made in ‘Drop Down 1’. Now let’s see how to create this. Here are the steps to create a dependent / conditional drop down list in Excel: Now, when you make the selection in Drop Down 1, the options listed in Drop Down List 2 would automatically update. Download the Example File How does this work? – The conditional drop down list (in cell E3) refers to =INDIRECT(D3). This means that when you select ‘Fruits’ in cell D3, the drop down list in E3 refers to the named range ‘Fruits’ (through the INDIRECT function) and hence lists all the items in that category. Important Note While Working with Conditional Drop Down Lists in Excel: When you have made the selection, and then you change the parent drop down, the dependent drop down would not change and would, therefore, be a wrong entry. For example, if you select the US as the country and then select Florida as the state, and then go back and change the country to India, the state would remain as Florida. Here is a great tutorial by Debra on clearing dependent (conditional) drop down lists in Excel when the selection is changed. If the main category is more than one word (for example, ‘Seasonal Fruits’ instead of ‘Fruits’), then you need to use the formula =INDIRECT(SUBSTITUTE(D3,” “,”_”)), instead of the simple INDIRECT function shown above. The reason for this is that Excel does not allow spaces in named ranges. So when you create a named range using more than one word, Excel automatically inserts an underscore in between words. So ‘Seasonal Fruits’ named range would be ‘Seasonal_Fruits’. Using the SUBSTITUTE function within the INDIRECT function makes sure that spaces are converted into underscores. You May Also Like the Following Excel Tutorials: Extract Data from Drop Down List Selection in Excel. Select Multiple Items from a Drop Down List in Excel. Creating a Dynamic Excel Filter Search Box. Display Main and Subcategory in Drop Down List in Excel. How to Insert Checkbox in Excel. Using a Radio Button (Option Button) in Excel.
Как сделать выпадающий список в таблице в Excel или Calc.
Пример подобного списка:
Выпадающий список в любом табличном редакторе
Понятно, что в этой клинике зубы вырывают только «пакетным» способом, или по 10, или по 20, или сразу по 30, но никак не по 11 или 27?!
Еще бы.
Простейший способ
Подходит, когда будущий список содержит ограниченное количество вариантов. Например,
- Да
- Хз
- Нет
Excel
Пишем на листе короткий список пациентов. Хватает даже одного — «Иван».
Выделяем ячейку справа от «Ивана» (как на картинке), и выбираем пункты меню Data > Validation > Allow: List > Source.
Пункты «Data» и «Validation» в русскоязычных версиях называются «Данные» и «Проверка»
В поле ‘Source’ вписываем это:
Да;Хз;Нет
Пояснение: это значения выпадающего списка. Если нужно что-то добавить, учитываем, что все значения разделяются через точку с запятой.
Внимание!
В зависимости от некоторых настроек Excel по-умолчанию, бывает, что разделителем является не точка с запятой (;), а простая запятая — (). Еще не могу сказать точно, где это настраивается, поэтому пробуем оба варианта.
Итак, контора пишет:
Создаем выпадающий список
Результат
В отдельной ячейке «под курсором» создан выпадающий список
Копируем эту ячейку as is (просто курсор находится «на ячейке», жмем Ctrl+C) повсюду, куда нам нужно (ставим курсор, куда нужно, и жмем Ctrl+V). Можно скопировать даже в другой файл Excel или на другой лист.
Чтобы ячейки всей колонки показывали выпадающий список, можно вставить эту ячейку со списком напротив пациента «Иван», и ухватив курсором ее нижний правый край, не отпуская левую кнопку, потянуть ее «вниз». Весь диапазон заполнится копиями нашей «ячейки со списком».
Итого:
Итоговый список пациентов и колонка с выпадающим списком
Calc
Все то же самое, выбираем пункты меню Data > Validity… > Allow: List > Entries.
Вписываем по одному значению на строку
- Да
- Хз
- Нет
Составляем список в OpenOffice Calc
А теперь предположим, что бухгалтерия уже две недели шурует с этим файлом, и вдруг требует вставить им еще и варианты «Может быть» и «Частично»…
Простейший способ
Excel
Ставим курсор на ячейку, в которой содержится наш список, и снова взываем к ее редактированию (Data > Validation > Allow: List > Source).
Редактируем список. Но не используем клавиши «влево — вправо».
Почему — просто попробуй, поймешь.
Обязательно жмакаем опцию «Apply these changes to all others cells with same range». Это объяснит Excel, что внесенные изменения относятся ко всем ячейкам, которые содержат редактируемыми нами список.
.
Calc
Надо выбрать все ячейки, в которых находится наш список, снова пройти по Data > Validity… > Allow: List > Entries и изменить значения.
Мудрейший способ
Делаем ссылку на отдельно хранящийся список.
Excel
Пишем на листе короткий список пациентов. Хватает даже одного — «Иван».
На том же листе, где-то в верхних (чтобы поближе было) ячейках следует расписать опции будущих выпадающих списков.
Пример:
- ячейка А1 — Да
- ячейка В1 — Хз
- ячейка С1 — Нет
- ячейка D1 — Может быть
Переходим к списку пациентов, выделяем первую ячейку в колонке «Заплатил?» (справа от «Ивана»). Ставим курсор туда, где должна будет начинаться будущая колонка с ячейками, которые содержат выпадающий список. В нашем случае — это колонка «Заплатил?» напротив ячейки со значением «Иван».
Выбираем пункты меню Data > Validation > Allow: List > Source.
Пункты «Data» и «Validation» в русскоязычных версиях называются «Данные» и «Проверка»
В поле ‘Source’ вписываем это:
=$A$1:$C$1
или это
=A1:C1
Или ничего не вписываем, а просто кликаем на квадрат, который находится в правом краю поля Source. Окно превратится в узкую полоску. Мы не пугаемся, а курсором выделяем на листе диапазон ячеек, из которых потом будут взяты данные: A1, B1, C1, D1, E1, F1, G1, и тд, если нужно. Можно даже выделять пустые ячейки, рассчитывая заполнить их позже (мало ли что бухгалтерия придумает).
В процессе этого выделения ячеек поле Source будет заполняться самостоятельно.
По-умолчанию Excel запишет выделенный пользователем диапазон через знак «$» — он указывает, что строго-настрого нужна именно эта ячейка, брать данные только из нее, чтобы ни случилось.
Если указать просто =A1:C1, то при изменении расположения ячеек на листе (что часто бывает) Excel будет считать, что адрес указанного диапазона может быть изменен.
Дальше все то же — при наведении курсора на ячейку с выпадающим списком появляется особый указатель. Пользуемся.
Чтобы ее «размножить» — хватаем за угол и тянем вниз… Или копируем куда-нибудь в другое место на листе.
Calc
Почти то же самое, но выбираем пункты меню Data > Validity… > Allow: Cell Range > Source.
Нужно указывать диапазон руками: $A$1:$C$1, к примеру. Замечу — без знака «=«.
Кстати
Можно организовать этот список в «реальный» список на языке табличного редактора.
Собственно, шаг необязательный, из разряда «Заголовок следует обрамлять тэгом
, но можно и «неформально» обрамить его тэгом — и покажи мне разницу…«, но имеет место бывать. Выделите ячейки с данными, которые должны попасть в выпадающий список (например, наименованиями товаров). Выберите в меню Вставка — Имя — Присвоить (Insert — Name — Define) и введите имя (можно любое, но обязательно без пробелов!) для выделенного диапазона (например Товары). Нажмите ОК. Можно сделать и так: Выделить диапазон ячеек (А1, В1, С1 в данном примере), и претворить его в «реальный» список В любом случае списку должно быть присвоено уникальное имя. Выделите ячейки (можно сразу несколько), в которых хотите получить выпадающий список и выберите в меню «Данные — Проверка» (Data — Validation). На первой вкладке «Параметры» из выпадающего списка «Тип данных» выберите вариант «Список» и введите в строчку «Источник» знак равно и имя диапазона (т.е. =Товары). Почему это круто: список «Товары» можно будет потом произвольно увеличивать или уменьшать. Табличный редактор будет учитывать не определенные ячейки, расположенные в определенном месте, а список as is. И все изменения в списке будут распространяться на все ячейки, которые «проверяют его для создания выпадающих списков». Горячие клавиши Курсор стоит на ячейке с выпадающим списком. Excel Alt+Down arrow. То есть, Alt+стрелка «вниз». Calc По-умолчанию не установлено. В справке написано Ctrl+D, но в справке баг (увы). Поэтому назначаем лично: Tools > Customize > Keyboard > Shortcut Keys Проскроллить и выбрать желаемое сочетание клавиш для открытия существующего списка. Я выбрал Ctrl+Down. Внимание, Alt+Down недоступно (вообще все сочетания с Alt тут недоступны для редактирования). В Functions > Category выбрать Edit. В Functions > Function выбрать Selection List. Нажать на кнопку Modify. Дополнение Всякие другие волшебства на тему выпадающих списков см. на Planeta Excel. Особенно «Ссылки по теме«. Прием комментариев к этой записи завершён. «Как зделать так чбо если в віпадающем списке нет нужного варианта я в ручную набираю в етой ячейке и оно автоматически добавляется в віпадающий список, и след раз уже там есть» — хз. Тут нам не то, и не это. Не надо задавать вопросы о том, как сделать ещё что-то с этими прекрасными выпадающими списками. Здесь даже не форум по Excel. Это блог о тестировании программного обеспечения. Вы же любите тестировать, правда?
Create a Drop-down List | Tips and Tricks Drop-down lists in Excel are helpful if you want to be sure that users select an item from a list, instead of typing their own values. Create a Drop-down List To create a drop-down list in Excel, execute the following steps. 1. On the second sheet, type the items you want to appear in the drop-down list. 2. On the first sheet, select cell B1. 3. On the Data tab, in the Data Tools group, click Data Validation. The ‘Data Validation’ dialog box appears. 4. In the Allow box, click List. 5. Click in the Source box and select the range A1:A3 on Sheet2. 6. Click OK. Result: Note: if you don’t want users to access the items on Sheet2, you can hide Sheet2. To achieve this, right click on the sheet tab of Sheet2 and click on Hide. Tips and Tricks Below you can find a few tips and tricks when creating drop-down lists in Excel. 1. You can also type the items directly into the Source box, instead of using a range reference. Note: this makes your drop-down list case sensitive. For example, if a user types pizza, an error alert will be displayed. 2a. If you type a value that is not in the list, Excel shows an error alert. 2b. To allow other entries, on the Error Alert tab, uncheck ‘Show error alert after invalid data is entered’. 3. To automatically update the drop-down-list, when you add an item to the list on Sheet2, use the following formula: =OFFSET(Sheet2!$A$1,0,0,COUNTA(Sheet2!$A:$A),1) Explanation: the OFFSET function takes 5 arguments. Reference: Sheet2!$A$1, rows to offset: 0, columns to offset: 0, height: COUNTA(Sheet2!$A:$A), width: 1. COUNTA(Sheet2!$A:$A) counts the number of values in column A on Sheet2 that are not empty. When you add an item to the list on Sheet2, COUNTA(Sheet2!$A:$A) increases. As a result, the range returned by the OFFSET function expands and the drop-down list will be updated. 4. Do you want to take your Excel skills to the next level? Learn how to create dependent drop-down lists in Excel.
A drop-down list is an excellent way to give the user an option to select from a pre-defined list. It can be used while getting a user to fill a form, or while creating interactive Excel dashboards. Drop-down lists are quite common on websites/apps and are very intuitive for the user. Watch Video – Creating a Drop Down List in Excel
In this tutorial, you’ll learn how to create a drop down list in Excel (it takes only a few seconds to do this) along with all the awesome stuff you can do with it. How to Create a Drop Down List in Excel In this section, you will learn the exacts steps to create an Excel drop-down list: Using Data from Cells. Entering Data Manually. Using the OFFSET formula. #1 Using Data from Cells Let’s say you have a list of items as shown below: Here are the steps to create an Excel Drop Down List: Select a cell where you want to create the drop down list. Go to Data –> Data Tools –> Data Validation. In the Data Validation dialogue box, within the Settings tab, select List as the Validation criteria. As soon as you select List, the source field appears. In the source field, enter =$A$2:$A$6, or simply click in the Source field and select the cells using the mouse and click OK. This will insert a drop down list in cell C2. Make sure that the In-cell dropdown option is checked (which is checked by default). If this option in unchecked, the cell does not show a drop down, however, you can manually enter the values in the list. Note: If you want to create drop down lists in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. Make sure that the cell references are absolute (such as $A$2) and not relative (such as A2, or A$2, or $A2). #2 By Entering Data Manually In the above example, cell references are used in the Source field. You can also add items directly by entering it manually in the source field. For example, let’s say you want to show two options, Yes and No, in the drop down in a cell. Here is how you can directly enter it in the data validation source field: This will create a drop-down list in the selected cell. All the items listed in the source field, separated by a comma, are listed in different lines in the drop down menu. All the items entered in the source field, separated by a comma, are displayed in different lines in the drop down list. Note: If you want to create drop down lists in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. #3 Using Excel Formulas Apart from selecting from cells and entering data manually, you can also use a formula in the source field to create an Excel drop down list. Any formula that returns a list of values can be used to create a drop-down list in Excel. For example, suppose you have the data set as shown below: Here are the steps to create an Excel drop down list using the OFFSET function: This will create a drop-down list that lists all the fruit names (as shown below). Note: If you want to create a drop-down list in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. Make sure that the cell references are absolute (such as $A$2) and not relative (such as A2, or A$2, or $A2). How this formula Works?? In the above case, we used an OFFSET function to create the drop down list. It returns a list of items from the ra It returns a list of items from the range A2:A6. Here is the syntax of the OFFSET function: =OFFSET(reference, rows, cols, , ) It takes five arguments, where we specified the reference as A2 (the starting point of the list). Rows/Cols are specified as 0 as we don’t want to offset the reference cell. Height is specified as 5 as there are five elements in the list. Now, when you use this formula, it returns an array that has the list of the five fruits in A2:A6. Note that if you enter the formula in a cell, select it and press F9, you would see that it returns an array of the fruit names. Creating a Dynamic Drop Down List in Excel (Using OFFSET) The above technique of using a formula to create a drop down list can be extended to create a dynamic drop down list as well. If you use the OFFSET function, as shown above, even if you add more items to the list, the drop down would not update automatically. You will have to manually update it each time you change the list. Here is a way to make it dynamic (and it’s nothing but a minor tweak in the formula): Select a cell where you want to create the drop down list (cell C2 in this example). Go to Data –> Data Tools –> Data Validation. In the Data Validation dialogue box, within the Settings tab, select List as the Validation criteria. As soon as you select List, the source field appears. In the source field, enter the following formula: =OFFSET($A$2,0,0,COUNTIF($A$2:$A$100,””)) Make sure that the In-cell drop down option is checked. Click OK. In this formula, I have replaced the argument 5 with COUNTIF($A$2:$A$100,””). The COUNTIF function counts the non-blank cells in the range A2:A100. Hence, the OFFSET function adjusts itself to include all the non-blank cells. Note: For this to work, there must NOT be any blank cells in between the cells that are filled. If you want to create a drop-down list in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. Make sure that the cell references are absolute (such as $A$2) and not relative (such as A2, or A$2, or $A2). Copy Pasting Drop-Down Lists in Excel You can copy paste the cells with data validation to other cells, and it will copy the data validation as well. For example, if you have a drop-down list in cell C2, and you want to apply it to C3:C6 as well, simply copy the cell C2 and paste it in C3:C6. This will copy the drop-down list and make it available in C3:C6 (along with the drop down, it will also copy the formatting). If you only want to copy the drop down and not the formatting, here are the steps: This will only copy the drop down and not the formatting of the copied cell. Caution while Working with Excel Drop Down List You need to to be careful when you are working with drop down lists in Excel. When you copy a cell (that does not contain a drop down list) over a cell that contains a drop down list, the drop down list is lost. The worst part of this is that Excel will not show any alert or prompt to let the user know that a drop down will be overwritten. How to Select All Cells that have a Drop Down List in it Sometimes, it ‘s hard to know which cells contain the drop down list. Hence, it makes sense to mark these cells by either giving it a distinct border or a background color. Instead of manually checking all the cells, there is a quick way to select all the cells that have drop-down lists (or any data validation rule) in it. This would instantly select all the cells that have a data validation rule applied to it (this includes drop down lists as well). Now you can simply format the cells (give a border or a background color) so that visually visible and you don’t accidentally copy another cell on it. Here is another technique by Jon Acampora you can use to always keep the drop down arrow icon visible. You can also see some ways to do this in this video by Mr. Excel. Creating a Dependent / Conditional Excel Drop Down List Here is a video on how to create a dependent drop-down list in Excel. If you prefer reading over watching a video, keep reading. Sometimes, you may have more than one drop-down list and you want the items displayed in the second drop down to be dependent on what the user selected in the first drop-down. These are called dependent or conditional drop down lists. Below is an example of a conditional/dependent drop down list: In the above example, when the items listed in ‘Drop Down 2’ are dependent on the selection made in ‘Drop Down 1’. Now let’s see how to create this. Here are the steps to create a dependent / conditional drop down list in Excel: Now, when you make the selection in Drop Down 1, the options listed in Drop Down List 2 would automatically update. Download the Example File
How does this work? – The conditional drop down list (in cell E3) refers to =INDIRECT(D3). This means that when you select ‘Fruits’ in cell D3, the drop down list in E3 refers to the named range ‘Fruits’ (through the INDIRECT function) and hence lists all the items in that category. Important Note While Working with Conditional Drop Down Lists in Excel: When you have made the selection, and then you change the parent drop down, the dependent drop down would not change and would, therefore, be a wrong entry. For example, if you select the US as the country and then select Florida as the state, and then go back and change the country to India, the state would remain as Florida. Here is a great tutorial by Debra on clearing dependent (conditional) drop down lists in Excel when the selection is changed. If the main category is more than one word (for example, ‘Seasonal Fruits’ instead of ‘Fruits’), then you need to use the formula =INDIRECT(SUBSTITUTE(D3,” “,”_”)), instead of the simple INDIRECT function shown above. The reason for this is that Excel does not allow spaces in named ranges. So when you create a named range using more than one word, Excel automatically inserts an underscore in between words. So ‘Seasonal Fruits’ named range would be ‘Seasonal_Fruits’. Using the SUBSTITUTE function within the INDIRECT function makes sure that spaces are converted into underscores. You May Also Like the Following Excel Tutorials: Extract Data from Drop Down List Selection in Excel. Select Multiple Items from a Drop Down List in Excel. Creating a Dynamic Excel Filter Search Box. Display Main and Subcategory in Drop Down List in Excel. How to Insert Checkbox in Excel. Using a Radio Button (Option Button) in Excel.
How does this work? – The conditional drop down list (in cell E3) refers to =INDIRECT(D3). This means that when you select ‘Fruits’ in cell D3, the drop down list in E3 refers to the named range ‘Fruits’ (through the INDIRECT function) and hence lists all the items in that category. Important Note While Working with Conditional Drop Down Lists in Excel: When you have made the selection, and then you change the parent drop down, the dependent drop down would not change and would, therefore, be a wrong entry. For example, if you select the US as the country and then select Florida as the state, and then go back and change the country to India, the state would remain as Florida. Here is a great tutorial by Debra on clearing dependent (conditional) drop down lists in Excel when the selection is changed. If the main category is more than one word (for example, ‘Seasonal Fruits’ instead of ‘Fruits’), then you need to use the formula =INDIRECT(SUBSTITUTE(D3,” “,”_”)), instead of the simple INDIRECT function shown above. The reason for this is that Excel does not allow spaces in named ranges. So when you create a named range using more than one word, Excel automatically inserts an underscore in between words. So ‘Seasonal Fruits’ named range would be ‘Seasonal_Fruits’. Using the SUBSTITUTE function within the INDIRECT function makes sure that spaces are converted into underscores. You May Also Like the Following Excel Tutorials: Extract Data from Drop Down List Selection in Excel. Select Multiple Items from a Drop Down List in Excel. Creating a Dynamic Excel Filter Search Box. Display Main and Subcategory in Drop Down List in Excel. How to Insert Checkbox in Excel. Using a Radio Button (Option Button) in Excel.
Содержание
- Создание дополнительного списка
- Создание выпадающего списка с помощью инструментов разработчика
- Связанные списки
- Вопросы и ответы
При работе в программе Microsoft Excel в таблицах с повторяющимися данными, очень удобно использовать выпадающий список. С его помощью можно просто выбирать нужные параметры из сформированного меню. Давайте выясним, как сделать раскрывающийся список различными способами.
Создание дополнительного списка
Самым удобным, и одновременно наиболее функциональным способом создания выпадающего списка, является метод, основанный на построении отдельного списка данных.
Прежде всего, делаем таблицу-заготовку, где собираемся использовать выпадающее меню, а также делаем отдельным списком данные, которые в будущем включим в это меню. Эти данные можно размещать как на этом же листе документа, так и на другом, если вы не хотите, чтобы обе таблице располагались визуально вместе.
Выделяем данные, которые планируем занести в раскрывающийся список. Кликаем правой кнопкой мыши, и в контекстном меню выбираем пункт «Присвоить имя…».
Открывается форма создания имени. В поле «Имя» вписываем любое удобное наименование, по которому будем узнавать данный список. Но, это наименование должно начинаться обязательно с буквы. Можно также вписать примечание, но это не обязательно. Жмем на кнопку «OK».
Переходим во вкладку «Данные» программы Microsoft Excel. Выделяем область таблицы, где собираемся применять выпадающий список. Жмем на кнопку «Проверка данных», расположенную на Ленте.
Открывается окно проверки вводимых значений. Во вкладке «Параметры» в поле «Тип данных» выбираем параметр «Список». В поле «Источник» ставим знак равно, и сразу без пробелов пишем имя списка, которое присвоили ему выше. Жмем на кнопку «OK».
Выпадающий список готов. Теперь, при нажатии на кнопку у каждой ячейки указанного диапазона будет появляться список параметров, среди которых можно выбрать любой для добавления в ячейку.
Создание выпадающего списка с помощью инструментов разработчика
Второй способ предполагает создание выпадающего списка с помощью инструментов разработчика, а именно с использованием ActiveX. По умолчанию, функции инструментов разработчика отсутствуют, поэтому нам, прежде всего, нужно будет их включить. Для этого, переходим во вкладку «Файл» программы Excel, а затем кликаем по надписи «Параметры».
В открывшемся окне переходим в подраздел «Настройка ленты», и ставим флажок напротив значения «Разработчик». Жмем на кнопку «OK».
После этого, на ленте появляется вкладка с названием «Разработчик», куда мы и перемещаемся. Чертим в Microsoft Excel список, который должен стать выпадающим меню. Затем, кликаем на Ленте на значок «Вставить», и среди появившихся элементов в группе «Элемент ActiveX» выбираем «Поле со списком».
Кликаем по месту, где должна быть ячейка со списком. Как видите, форма списка появилась.
Затем мы перемещаемся в «Режим конструктора». Жмем на кнопку «Свойства элемента управления».
Открывается окно свойств элемента управления. В графе «ListFillRange» вручную через двоеточие прописываем диапазон ячеек таблицы, данные которой будут формировать пункты выпадающего списка.
Далее, кликаем по ячейке, и в контекстном меню последовательно переходим по пунктам «Объект ComboBox» и «Edit».
Выпадающий список в Microsoft Excel готов.
Чтобы сделать и другие ячейки с выпадающим списком, просто становимся на нижний правый край готовой ячейки, нажимаем кнопку мыши, и протягиваем вниз.
Связанные списки
Также, в программе Excel можно создавать связанные выпадающие списки. Это такие списки, когда при выборе одного значения из списка, в другой графе предлагается выбрать соответствующие ему параметры. Например, при выборе в списке продуктов картофеля, предлагается выбрать как меры измерения килограммы и граммы, а при выборе масла растительного – литры и миллилитры.
Прежде всего, подготовим таблицу, где будут располагаться выпадающие списки, и отдельно сделаем списки с наименованием продуктов и мер измерения.
Присваиваем каждому из списков именованный диапазон, как это мы уже делали ранее с обычными выпадающими списками.
В первой ячейке создаём список точно таким же образом, как делали это ранее, через проверку данных.
Во второй ячейке тоже запускаем окно проверки данных, но в графе «Источник» вводим функцию «=ДВССЫЛ» и адрес первой ячейки. Например, =ДВССЫЛ($B3).
Как видим, список создан.
Теперь, чтобы и нижние ячейки приобрели те же свойства, как и в предыдущий раз, выделяем верхние ячейки, и при нажатой клавише мышки «протаскиваем» вниз.
Всё, таблица создана.
Мы разобрались, как сделать выпадающий список в Экселе. В программе можно создавать, как простые выпадающие списки, так и зависимые. При этом, можно использовать различные методы создания. Выбор зависит от конкретного предназначения списка, целей его создания, области применения, и т.д.
A drop-down list is an excellent way to give the user an option to select from a pre-defined list.
It can be used while getting a user to fill a form, or while creating interactive Excel dashboards.
Drop-down lists are quite common on websites/apps and are very intuitive for the user.
Watch Video – Creating a Drop Down List in Excel
In this tutorial, you’ll learn how to create a drop down list in Excel (it takes only a few seconds to do this) along with all the awesome stuff you can do with it.
How to Create a Drop Down List in Excel
In this section, you will learn the exacts steps to create an Excel drop-down list:
- Using Data from Cells.
- Entering Data Manually.
- Using the OFFSET formula.
#1 Using Data from Cells
Let’s say you have a list of items as shown below:
Here are the steps to create an Excel Drop Down List:
- Select a cell where you want to create the drop down list.
- Go to Data –> Data Tools –> Data Validation.
- In the Data Validation dialogue box, within the Settings tab, select List as the Validation criteria.
- As soon as you select List, the source field appears.
- In the source field, enter =$A$2:$A$6, or simply click in the Source field and select the cells using the mouse and click OK. This will insert a drop down list in cell C2.
- Make sure that the In-cell dropdown option is checked (which is checked by default). If this option in unchecked, the cell does not show a drop down, however, you can manually enter the values in the list.
Note: If you want to create drop down lists in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. Make sure that the cell references are absolute (such as $A$2) and not relative (such as A2, or A$2, or $A2).
#2 By Entering Data Manually
In the above example, cell references are used in the Source field. You can also add items directly by entering it manually in the source field.
For example, let’s say you want to show two options, Yes and No, in the drop down in a cell. Here is how you can directly enter it in the data validation source field:
This will create a drop-down list in the selected cell. All the items listed in the source field, separated by a comma, are listed in different lines in the drop down menu.
All the items entered in the source field, separated by a comma, are displayed in different lines in the drop down list.
Note: If you want to create drop down lists in multiple cells at one go, select all the cells where you want to create it and then follow the above steps.
#3 Using Excel Formulas
Apart from selecting from cells and entering data manually, you can also use a formula in the source field to create an Excel drop down list.
Any formula that returns a list of values can be used to create a drop-down list in Excel.
For example, suppose you have the data set as shown below:
Here are the steps to create an Excel drop down list using the OFFSET function:
This will create a drop-down list that lists all the fruit names (as shown below).
Note: If you want to create a drop-down list in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. Make sure that the cell references are absolute (such as $A$2) and not relative (such as A2, or A$2, or $A2).
How this formula Works??
In the above case, we used an OFFSET function to create the drop down list. It returns a list of items from the ra
It returns a list of items from the range A2:A6.
Here is the syntax of the OFFSET function: =OFFSET(reference, rows, cols, [height], [width])
It takes five arguments, where we specified the reference as A2 (the starting point of the list). Rows/Cols are specified as 0 as we don’t want to offset the reference cell. Height is specified as 5 as there are five elements in the list.
Now, when you use this formula, it returns an array that has the list of the five fruits in A2:A6. Note that if you enter the formula in a cell, select it and press F9, you would see that it returns an array of the fruit names.
Creating a Dynamic Drop Down List in Excel (Using OFFSET)
The above technique of using a formula to create a drop down list can be extended to create a dynamic drop down list as well. If you use the OFFSET function, as shown above, even if you add more items to the list, the drop down would not update automatically. You will have to manually update it each time you change the list.
Here is a way to make it dynamic (and it’s nothing but a minor tweak in the formula):
- Select a cell where you want to create the drop down list (cell C2 in this example).
- Go to Data –> Data Tools –> Data Validation.
- In the Data Validation dialogue box, within the Settings tab, select List as the Validation criteria. As soon as you select List, the source field appears.
- In the source field, enter the following formula: =OFFSET($A$2,0,0,COUNTIF($A$2:$A$100,”<>”))
- Make sure that the In-cell drop down option is checked.
- Click OK.
In this formula, I have replaced the argument 5 with COUNTIF($A$2:$A$100,”<>”).
The COUNTIF function counts the non-blank cells in the range A2:A100. Hence, the OFFSET function adjusts itself to include all the non-blank cells.
Note:
- For this to work, there must NOT be any blank cells in between the cells that are filled.
- If you want to create a drop-down list in multiple cells at one go, select all the cells where you want to create it and then follow the above steps. Make sure that the cell references are absolute (such as $A$2) and not relative (such as A2, or A$2, or $A2).
Copy Pasting Drop-Down Lists in Excel
You can copy paste the cells with data validation to other cells, and it will copy the data validation as well.
For example, if you have a drop-down list in cell C2, and you want to apply it to C3:C6 as well, simply copy the cell C2 and paste it in C3:C6. This will copy the drop-down list and make it available in C3:C6 (along with the drop down, it will also copy the formatting).
If you only want to copy the drop down and not the formatting, here are the steps:
This will only copy the drop down and not the formatting of the copied cell.
Caution while Working with Excel Drop Down List
You need to to be careful when you are working with drop down lists in Excel.
When you copy a cell (that does not contain a drop down list) over a cell that contains a drop down list, the drop down list is lost.
The worst part of this is that Excel will not show any alert or prompt to let the user know that a drop down will be overwritten.
How to Select All Cells that have a Drop Down List in it
Sometimes, it ‘s hard to know which cells contain the drop down list.
Hence, it makes sense to mark these cells by either giving it a distinct border or a background color.
Instead of manually checking all the cells, there is a quick way to select all the cells that have drop-down lists (or any data validation rule) in it.
This would instantly select all the cells that have a data validation rule applied to it (this includes drop down lists as well).
Now you can simply format the cells (give a border or a background color) so that visually visible and you don’t accidentally copy another cell on it.
Here is another technique by Jon Acampora you can use to always keep the drop down arrow icon visible. You can also see some ways to do this in this video by Mr. Excel.
Creating a Dependent / Conditional Excel Drop Down List
Here is a video on how to create a dependent drop-down list in Excel.
If you prefer reading over watching a video, keep reading.
Sometimes, you may have more than one drop-down list and you want the items displayed in the second drop down to be dependent on what the user selected in the first drop-down.
These are called dependent or conditional drop down lists.
Below is an example of a conditional/dependent drop down list:
In the above example, when the items listed in ‘Drop Down 2’ are dependent on the selection made in ‘Drop Down 1’.
Now let’s see how to create this.
Here are the steps to create a dependent / conditional drop down list in Excel:
Now, when you make the selection in Drop Down 1, the options listed in Drop Down List 2 would automatically update.
Download the Example File
How does this work? – The conditional drop down list (in cell E3) refers to =INDIRECT(D3). This means that when you select ‘Fruits’ in cell D3, the drop down list in E3 refers to the named range ‘Fruits’ (through the INDIRECT function) and hence lists all the items in that category.
Important Note While Working with Conditional Drop Down Lists in Excel:
- When you have made the selection, and then you change the parent drop down, the dependent drop down would not change and would, therefore, be a wrong entry. For example, if you select the US as the country and then select Florida as the state, and then go back and change the country to India, the state would remain as Florida. Here is a great tutorial by Debra on clearing dependent (conditional) drop down lists in Excel when the selection is changed.
- If the main category is more than one word (for example, ‘Seasonal Fruits’ instead of ‘Fruits’), then you need to use the formula =INDIRECT(SUBSTITUTE(D3,” “,”_”)), instead of the simple INDIRECT function shown above. The reason for this is that Excel does not allow spaces in named ranges. So when you create a named range using more than one word, Excel automatically inserts an underscore in between words. So ‘Seasonal Fruits’ named range would be ‘Seasonal_Fruits’. Using the SUBSTITUTE function within the INDIRECT function makes sure that spaces are converted into underscores.
You May Also Like the Following Excel Tutorials:
- Extract Data from Drop Down List Selection in Excel.
- Select Multiple Items from a Drop Down List in Excel.
- Creating a Dynamic Excel Filter Search Box.
- Display Main and Subcategory in Drop Down List in Excel.
- How to Insert Checkbox in Excel.
- Using a Radio Button (Option Button) in Excel.
- How to Remove Drop-Down List in Excel?
An Excel drop-down list can make it easier for the average Microsoft Excel user to enter data. Using a drop-down limits the entry choices for a selected cell, speeding data entry and reducing data entry error. In this article, I’ll show you a quick and easy way to create a drop-down list using Excel’s Data Validation feature.
SEE: Windows, Linux, and Mac commands everyone needs to know (free PDF) (TechRepublic)
I’m using Microsoft 365 desktop on a Windows 10 64-bit system, but you can use an earlier version. For your convenience, you can download the demonstration .xlsx and .xls files.
However, the Table object isn’t available in the older menu versions (.xls) so some of this article won’t apply if you’re still using an .xls version. You can still use a data range for the list, but the populated drop-down won’t update when you update the list items. Microsoft Excel for the web supports data validation and you can even add a data validation drop-down list in the web version. You can’t expand an Excel Table by tabbing through the cell to insert a new row, but you can still add a row.
What is a drop-down list in Excel?
Figure A shows a simple drop-down list in an Excel sheet. To use the drop-down, click the data entry cell (D2 in this case) and then click the drop-down arrow to display the list of values in B3:B6. If a user tries to enter something that isn’t an item within that list of values, Excel rejects the entry, protecting the validity of your data.
Figure A
To create a data validation drop-down list in Excel, you need two things: A list of values and a blank cell to use as the data entry cell. The list is in B3:B6 and the data entry cell is D2.
How to add a data validation drop-down in Excel
Now that you know how users and your data will benefit from a drop-down list, let’s add one to D2. First, add the short list (Figure A) to B3:B6 and format it as an Excel Table object. Simply click any cell in the list and press Ctrl + T. In the resulting dialog, make sure the My Table Has Headers option is selected, and click OK. Technically, the list items don’t need to be formatted as a Table, but a Table makes the drop-down dynamic.
To add the drop-down list in our example to an Excel cell, do the following:
- Select D2 to follow the example, but you can put the drop-down anywhere.
- Click the Data tab and then click Data Validation in the Data Tools group. Click the Settings tab, if necessary.
- In the resulting Data Validation dialog, click List from the Allow options drop-down.
- Click the Source control and highlight B3:B6 — the list items.
- Click OK.
Figure B
Click the drop-down to see the list shown earlier (Figure A).
You can add a drop-down to multiple Excel cells. Select the range of data input cells (Step 1) instead of a single Excel cell. Doing so will populate multiple drop-downs with the same list items. It even works for noncontiguous Excel cells. Hold down the Shift key while you click the appropriate Excel cells. The average user won’t benefit from this added functionality, but it’s good to know that it’s possible.
SEE: Why Microsoft Lists is the new Excel (TechRepublic)
Earlier, you formatted the list items as a Table object. Now, let’s discover why by entering a new list item into the Table:
- Select B6 and press Tab to add a new cell to the Table.
- Enter “goat” and press Enter.
Excel added “goat” to the drop-down list (Figure C). You didn’t have to do a thing, other than enter the new list item. That’s the power of Excel’s Table object. I recommend that you use them whenever possible. To remove an item from the drop-down, remove it from the Table.
Figure C
How to use a drop-down in an Excel Table
We can expand on the Table topic, because if you add a data validation drop-down to the first cell in a Table, Excel will extend the drop-down to each new record. Let’s take a quick look at this bit of magic:
- Create a quick Table by selecting F2:G4. Then, press Ctrl + T, click the My Table has Headers option, and click OK.
- Select D4, the cell with the drop-down we created earlier, and press Ctrl + C.
- Select G3, the first cell in that column and press Ctrl + v to copy the drop-down to that cell.
The drop-down is available in the first cell in column G (Figure D).
Select an item from the drop-down and then press Tab to insert a new record into the Table. Tab to G4 and you’ll see that the Table copies the drop-down automatically (Figure E). If you’re using Excel for the Web, right-click the Table, choose Insert from the resulting submenu, and then select Table Rows Above. The web version will copy the drop-down as the desktop version does.
Figure D
Figure E
You could’ve created the data validation list using the interface, as you did earlier. However, I want you to know how easy it is to copy a drop-down.
By now, you’ve probably noticed that you can only see the drop-down arrow if you click on the Excel cell. This is a bit of a deterrent. I recommend that you choose a format, such as a fill color, so it’s easy to find. Users must choose an item; if they try to enter their own data, they’ll trigger an error. There are options for displaying a specific error message, but we won’t cover that in this article.
Using multiple links to Microsoft Excel workbooks
It’s possible to populate a drop-down by referencing list items in another sheet or even another workbook. The process takes a bit of work, so we didn’t cover this option in this article.
Both workbooks must be open. If you try this, keep in mind that multiple links where values in workbook1 depend on values in workbook2, which links to workbook3, and so on, are hard to manage. Users forget to close files, and sometimes they even move files. If you’re the only person working with linked Excel files, you might not run into trouble, but if other users are reviewing and modifying them, you’re asking for difficulty. If you truly need that much linking, you might consider a new design.
Stay tuned
In a future article, I’ll show you how to populate a drop-down in one workbook by referencing items in another workbook. Linking between workbooks isn’t difficult, but it isn’t intuitive.
We come across drop-down lists on the internet and other software applications all the time. They are useful because they limit the options available to the user, as only pre-validated items can be selected. In this post, we’ll look at how to add a drop-down list in Excel.
In Excel, there are three different types of worksheet-based drop-down lists:
- Data validation
- Form control
- ActiveX
So how do you know which one you should use? As with so many things, the answer is “it depends”. Let’s take a look at these three options and understand where to use each one.
Download the example file: Click the link below to download the example file used for this post:
Data validation drop-down list
The most common form of drop-down list is a data validation list. Let’s create one of these.
Enter the values to be used in the drop-down list into a range of cells; these are known as the ‘list items’.
Then select the cell in which the drop-down should exist.
Click Data > Data Validation (drop down) > Data Validation…
The data validation dialog box opens. On the Settings tab, select list from the allow box, and enter the range of cells containing the list in the source box.
Click OK to close the data validation dialog box.
To use the drop-down, click on the cell containing the data validation list. We can now only select a value from the list.
Typing an invalid entry in the cell will result in an error message.
Other data validation list options
There is lots of flexibility in this type of drop-down list.
List input as hardcoded values
The list doesn’t have to be on a worksheet; the values can be hardcoded into the source field. The screenshot below shows how to include the options Yes, No and Maybe without using cells; each list item is separated by a comma
A drop-down list created in this way would look like this:
TOP TIP: If we need to use a comma in the list item text, press ALT+0130 to enter the comma, instead of a regular comma character.
List input as rows or columns
If using values in worksheet cells as the source, the list of values can be arranged in rows or columns (but not both at the same time)
List input as a named range
The list of values can be stored in a named range, provided it is a continuous range of rows or columns.
TOP TIP: If you can’t remember the name of the named range, press F3 and select from the Paste Name dialog box.
List input as a Table
I love Tables, but they don’t work as well with data validation lists as they should. Check out this post to find out how to make it work.
List input as dynamic arrays
If you have a dynamic array enabled version of Excel (only Microsoft 365 and Excel 2021), then data validation lists can contain the result of a dynamic array.
If the first cell in the output array were in cell A2, we could use =A2# as the reference in the source box. This method is excellent for advanced techniques, such as shrinking lists, or dependant lists.
Input messages
The Input Message tab of the data validation dialog box provides the settings to display a message when a user clicks the data validation cell.
The message is intended to provide guidance for the user so they know what type of information to enter.
We only need to provide a title and an input message.
Make sure show input message when cell is selected is checked; otherwise, the message will not appear.
Error alerts
The purpose of a drop-down list of to select valid entries from a list. As a result, the chance of invalid data entry is significantly reduced. However, users can still enter text directly into the cell; therefore, invalid data entry is still possible.
The default message doesn’t provide any guidance regarding why the entry is invalid. But we can provide custom messages inside the Error Alert tab.
To provide a custom message, we only need to provide a title, an error message, and select a style icon.
Make sure show error alert after invalid data is entered is checked; otherwise, no error message will appear; a user could enter any value.
Useful notes
Before we move on, I want to make you aware of a few issues with data validation drop-down lists in Excel:
Identifying the cells containing data validation
The drop-down arrow is only visible when a user clicks on the cell. Therefore, here is no visual indicator that a cell contains a drop-down list exists until it is selected. Formatting the cell may be useful to provide a better user experience.
Copy and Paste dangers
When we copy and paste cells containing the data validation to other cells, the drop-down list is transferred as part of the format. This is great if we want to create a lot of drop-down lists containing the same items.
However… now for the danger part…
A user can copy and paste values into a cell, even if those values are not in the data validation list. If a user types into a cell, the data validation process runs; if a user pastes values into a cell, the validation is not triggered at all. This is a big problem
Here is another quirk…
If the worksheet is protected, the copy and paste overwrites the value, but retains the drop-down list. However, if the sheet is not protected, copy and paste applies the format from the source cell. As a result, the data validation drop-down list can disappear completely.
Highlight all cells with invalid options
Excel can perform a check to identify any cells containing values that do not meet the data validation criteria. Click Data > Data Validation (drop-down) > Circle Invalid Data
This will highlight the cells as follows:
To remove the circles, click Data > Data Validation (drop-down) > Clear Validation Circles.
Form control drop-down list
Form controls can be used as another type of drop-down list in Excel. While they remove some of the negatives from data validation drop-downs, they come with their own unique challenges. VBA can be used to control form control elements; however in this post, we’ll be keeping things simple and looking at the basic non-VBA functionality (which is still pretty powerful).
Let’s start by creating a form control drop-down list. These are contained within the Developer ribbon.
Click Developer > Insert > Combo Box (Form Control)
The mouse pointer will change to a cross. Click and hold the mouse while you draw the location to place the drop-down list. Holding the ALT key while placing the object will also snap the drop-down to the grid.
Right-click on the drop-down list and select format control…
The format object window will open. Click on the control tab. The key fields are:
- Input range – the range of cells to include in the drop-down list.
- Cell link – the cell in which to output the value.
The cell selected for the cell link shows the chosen position in the drop-down box. As East is the third item in the list, cell F2 displays 3.
The biggest issue with the form control drop-down is that the cell link shows the position in the drop-down rather than the value itself. By using the INDEX function and the input range cells, we can retrieve the value from the list.
The formula in cell G2 is:
=INDEX(A2:A6,F2)
Input range options
With Form Control drop-down lists, the input range can be a standard cell range or a named range. Hardcoded lists and dynamic arrays are not compatible. However, we can use a dynamic array placed inside a named range as a workaround.
Useful notes
If we wish to have lots of drop-down lists, we can copy and paste a form control object. However, we must go into each drop-down individually to repoint to a new cell link.
We cannot enter text into the drop-down list; therefore, it is not possible to select an invalid entry.
Form controls are not compatible with Excel Online.
ActiveX drop-down list
Now for the final type of drop-down list in Excel; ActiveX drop-down list.
Click Developer > Insert > Combo Box (ActiveX Control)
Just like the form control option shown above, draw the drop-down box on the worksheet.
Right-click on the drop-down and select properties from the menu.
The properties dialog box opens. The critical parameters for our purposes are LinkedCell and ListFillRange. These are similar to the form control drop-down list; enter equivalent ranges into these fields. Click on the [x] in the top right corner to close the Properties window.
Clicking Developer > Design Mode toggles between using and editing the drop-down list. When in design mode, the drop-down can be edited, but not used. Vice versa, when in display mode, the drop-down can be used, but not edited.
Unlike the form control version, the ActiveX drop-down displays the selected value directly in the linked cell.
ActiveX has more extensive formatting options than form controls.
Useful notes
ActiveX drop-down boxes have many features to be aware of:
- When in design mode, the ActiveX drop-down can be copied or deleted, but not when in display mode.
- ActiveX doesn’t work on a Mac or Excel Online. So, if you want a genuinely cross-platform workbook, this is not the option for you.
Which option to choose?
So, which option should you choose for a drop-down list in Excel? As I said in the introduction, it depends. My general advice is:
- Avoid ActiveX, if possible.
- Use Form Controls for single-cell selections where strict input is required.
- Use Data Validation, where a drop-down may need to be copied.
That’s just a basic rule I use. In all cases, suitable worksheet protection needs to be applied to prevent accidental changes. Ultimately, you’ll need to experiment with all the options and work out what is best for your circumstances.
About the author
Hey, I’m Mark, and I run Excel Off The Grid.
My parents tell me that at the age of 7 I declared I was going to become a qualified accountant. I was either psychic or had no imagination, as that is exactly what happened. However, it wasn’t until I was 35 that my journey really began.
In 2015, I started a new job, for which I was regularly working after 10pm. As a result, I rarely saw my children during the week. So, I started searching for the secrets to automating Excel. I discovered that by building a small number of simple tools, I could combine them together in different ways to automate nearly all my regular tasks. This meant I could work less hours (and I got pay raises!). Today, I teach these techniques to other professionals in our training program so they too can spend less time at work (and more time with their children and doing the things they love).
Do you need help adapting this post to your needs?
I’m guessing the examples in this post don’t exactly match your situation. We all use Excel differently, so it’s impossible to write a post that will meet everybody’s needs. By taking the time to understand the techniques and principles in this post (and elsewhere on this site), you should be able to adapt it to your needs.
But, if you’re still struggling you should:
- Read other blogs, or watch YouTube videos on the same topic. You will benefit much more by discovering your own solutions.
- Ask the ‘Excel Ninja’ in your office. It’s amazing what things other people know.
- Ask a question in a forum like Mr Excel, or the Microsoft Answers Community. Remember, the people on these forums are generally giving their time for free. So take care to craft your question, make sure it’s clear and concise. List all the things you’ve tried, and provide screenshots, code segments and example workbooks.
- Use Excel Rescue, who are my consultancy partner. They help by providing solutions to smaller Excel problems.
What next?
Don’t go yet, there is plenty more to learn on Excel Off The Grid. Check out the latest posts:
How to Create a Drop-down List in Excel
in 60 Seconds or Less
A drop-down list makes the user select text or values from a list of options, instead of typing them manually in a cell.
This enables you (the creator) to control all data entries for important cells.
The drop-down list is the most popular data validation tool in Excel.
And it looks pretty cool too😎
Just follow these 5 steps and learn how to insert a drop-down list in Excel.
Also, I cover how to control the input message and error alert.
If you want to follow along with what I do, download the Excel project file here.
Step 1: Choose drop-down list items
Drop-down lists control data entry.
But before you insert the drop-down list you need to decide what data entries should be allowed. This is what we call the ‘list items’.
Pick anywhere you want to store the drop-down list items. It can be in the same sheet, another sheet, or another Excel file.
Write the desired drop-down menu options in a list.
Step 2: Go to the ‘Data’ tab
This step is easy😊
Simply move your cursor to the ‘Data’ tab and left-click it.
Step 3: Click ‘Data Validation’
Now click ‘Data validation’ in the middle of the ribbon.
(Do not click the little arrow – simply click the top part of the button).
Now, a dialog box called ‘Data validation’ appears. Here, you choose the settings for your drop-down list.
Let’s dive in🤿
Step 4: Allow data validation ‘List’
In the data validation dialog box, click the drop-down list and pick what kind of data validation method you want to use (how meta is that?!).
Select ‘List’ from the… well… list!
I promised you could add a drop-down list in less than 60 seconds, didn’t I?
So, let’s keep up the pace🏃🏽
Step 5: Select the source list
Remember in step 1 where you chose the allowed options (list items) for your drop-down list?
Now it’s time to connect that list of options with the drop-down menu.
Left-click once in the ‘Source:’ field.
Then go to the location of your list with allowed values. The one you wrote in Step 1, remember?📝
Select the cells containing your drop-down list items.
PRO TIP
As you can see from the picture above, I included a few empty cells in the bottom of the source range. That way, I can add new drop-down list items to the source just by writing in the blank cells.
This is much easier than going back and changing the source range size every time new items are added.
And it’s also much easier than creating a dynamic drop-down list, where the source range automatically adjusts to the data.
After you click ‘OK’ your drop-down list is ready for use.
Error alert
Drop-down lists are primarily for selecting data entry instead of typing it manually.
But the user can do manual data entry in the cell that contains the drop-down list.
But if invalid data is entered, an error alert will show.
The default error message doesn’t give a great indication of what the user can actually write in the cell.
To improve it, simply go to the ‘Error alert’ tab after clicking ‘Data validation’.
From here, make sure there’s a checkmark in the “Show error alert after invalid data is entered”.
Then, add the title and error message and choose an icon if you don’t like the default.
Then hit ‘OK’.
Now, this error message pops up whenever invalid data is entered into the cell.
If you don’t check the “Show error alert after invalid data is entered” checkbox, anyone can write anything in the cell with the drop-down list.
Input message
Drop-down menus, and data validation in general, make it harder to input something wrong in your spreadsheet.
But the ‘Input message’ addition makes data entry even easier – and more bulletproof.
When creating a drop-down list, you can add an input message from the ‘Input message tab’ in the data validation dialog box.
Simply type your input message and it will appear when the user selects the cell containing the drop-down list.
The input message is an easy way to improve the user experience of your spreadsheets – which is something most spreadsheet creators neglect.
That’s it – Now what?
You’ve just learned how to create a drop-down list in Excel.
Also, you can now control the error alert that is shown when invalid data is entered.
AND you can make the spreadsheet show a nice input message to make the data entry process easier for the user.
Well done👍
But there’s more to Excel than eradicating typos with drop-down lists.
Let’s stop and think: Why are typos such a menace?
Because they make your functions less effective.
Especially the functions: IF, SUMIF, and VLOOKUP.
And they happen to be 3 of the most important functions in Excel.
If you’re not proficient with those already, I strongly suggest you enroll in my 3-part free online course and learn IF, SUMIF, and VLOOKUP once and for all.
Other relevant resources
Drop-down lists are a part of a larger set of Excel features called ‘Data validation’. I’ve written the ultimate guide to data validation that teaches you everything you need to know. Check it out here.
There are also a few ways of using drop-downs that caters to niche scenarios. For instance, you can make drop-down lists where the list items change depending on what the user picks in another drop-down list.
That’s called dependent drop-down lists (some call them cascading drop-down lists), and you can learn all about it in my YouTube video here.
Pretty cool, right? 😎
In general, drop-down lists are great when typos and other invalid data entries are very annoying. Filters suffer greatly from typos. So does pivot tables and lookup functions such as VLOOKUP, INDEX MATCH, and XLOOKUP.
Thanks for reading👋
Kasper Langmann2022-08-04T10:58:03+00:00
Page load link
Creating a dropdown list in your Excel spreadsheet can help to increase the efficiency of your work. This might come in handy, especially when you want your coworkers to provide certain information that may be relevant to the company. By using an Excel dropdown list, you can control exactly what can be entered into a cell by giving the users an option to select from a pre-defined list.
When you add a dropdown list to a cell, an arrow will be displayed next to it. Clicking on this arrow will open up the list and give the user the option to choose one of the items on the list. This will not only save you space on your spreadsheet but also make you look like like a superuser and impress your co-workers and boss. Here’s a step-by-step guide on how to create a dropdown list in Excel.
Step 1: Define the Contents of Your List
1. Open up a new Excel worksheet and put down the contents you want to appear on your list. Make sure each entry occupies one cell, and all entries are vertically aligned in the same column. Also, ensure there are no blank cells between the entries. In our case our dropdown menu will open a list of cities to choose from.
2. Once you’re done assembling the list, highlight all the entries, right-click on them, and select “Define Name” from the menu that will show up.
3. This will open a new window with the title “New Name.” Choose a name for your list and enter the same in the “Name” text box.
4. Click “OK.”
Step 2: Adding Your Dropdown List to a Spreadsheet
The next step is to add your dropdown list to a spreadsheet. Here’s how to do it.
1. Open a new or existing worksheet where you want to place your dropdown list.
2. Highlight the cell where you want to place the dropdown list. Click the “Data” tab, then locate the “Data validation” icon in the data tools section and click on it.
3. A data validation box will appear that has three tabs: Settings, Input Message, and Error Alert. In the Settings tab, select “List” from the “Arrow” dropdown list. A new option titled “Source” will now appear at the bottom of the window. Click the text box and then enter a “=” sign, followed by the name of your dropdown list. In our case it should read =cities
.
The “Ignore blank” and “In-cell dropdown” boxes are checked by default. With the Ignore blank cell checked, it means it’s okay for people to leave the cell empty. But if you want every user to select an option from the cell, uncheck the box.
4. Click OK. That’s it. You have added a dropdown list to your spreadsheet.
With that completed, you can now proceed to the Input message tab.
Step 3: Set Input Message for Data Validation (Optional)
At times you may want a message (with description) to pop up when the cell containing the dropdown list is clicked. In that case you’ll need to click the “show input message” box in the Input message tab. You’ll also need to fill out the title and the input message in their respective boxes. Your dropdown list should now look something like the following image.
The last tab is for the error alert. Once defined, this one sends an error message if someone enters invalid data – data that is not on the list.
Wrapping Up
Dropdown lists are very common on websites and are very intuitive for the user. Their versatile nature renders them useful in virtually all industries. Be it in surveys, the business world or even in schools, you’ll always find the need to use Excel dropdown lists.
Was this article useful? Feel free to comment and share.
Kenneth Kimari
Kenn is a tech enthusiast by passion, Windows blogger by choice, and a massive coffee imbiber. He likes watching sci-fi movies in his free time and tearing gadgets apart so he can fix them.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox