Create a Searchable Drop Down List in Excel (2 Methods)

Get FREE Advanced Excel Exercises with Solutions!

This article illustrates how to create a searchable drop-down list in Excel. It shows the 2 ways you can do that in Excel using formulas and VBA. The following picture highlights the purpose of this article. Have a quick look through the article to see how it’s done.

Create a Searchable Drop Down List in Excel


Imagine you have the following dataset in the worksheet named States. The dataset contains information about the first 13 states of the USA.

Now you want to create a searchable dropdown list in cell B4 in the worksheet named Dropdown.

Then you need to follow the steps highlighted in the following methods.


1. Applying Excel Formula to Create Searchable Drop Down List

First, we will create a searchable dropdown list using Excel formulas. Follow the steps below to be able to do that.

📌 Steps

  • First, enter the following formula in cell E5 in the sheet named States.
=FILTER(B5:B17,ISNUMBER(SEARCH(Dropdown!B4,B5:B17)),"Not Found")
  • The SEARCH function in the formula searches for a given value.
  • The ISNUMBER function returns True if the output of the Search function is a number. Otherwise, it returns False.
  • The FILTER function filters data according to the given criteria.

Formula to Create a Searchable Drop Down List in Excel

  • Then select cell B4 in the Dropdown worksheet. Next select Data >> Data Validation.

  • Then select the Settings tab in the Data Validation window. Next choose List in the Allow: field using the dropdown arrow.
  • Then enter the following formula in the Source field.
=States!$E$5#
  • After that, go to the Error Alert tab.

  • Now uncheck Show error alert after invalid data is entered. Then hit the OK button.

  • Finally, a searchable dropdown list has been created. Now type something (new) in cell B4. Then select the dropdown arrow visible at the lower right corner of the cell. After that, you will see all the relevant search results as shown in the following picture.

Create a Searchable Drop Down List in Excel

Read More: How to Create Drop Down List in Multiple Columns in Excel


2. Using Excel VBA to Create Searchable Drop Down List

Now, suppose you don’t want to select any dropdown arrow to see the relevant results. Rather you want to see the search results as shown in Google Search. Then follow the steps below.

📌 Steps

  • First, you need to follow the steps before Data >> Data Validation only in the earlier method.
  • Then select cell E5 in the States worksheet. After that, select Formulas >> Name Manager.

  • Next select New in the Name Manager window to define a list.

  • Then change the Name to Dropdown_List in the New Name window.
  • After that enter the following formula in the Refers to field. Then hit the OK button. The formula uses the INDEX and COUNTIF functions.
=States!$E$5:$E$5:INDEX(States!$E$5:$E$17,COUNTIF(States!$E$5:$E$17,"?*"))

  • Now go to the Dropdown worksheet. Then select Insert >> Combo Box from the Developer tab.

  • Next drag the mouse to properly resize the ComboBox as shown below.

  • After that, you will see a new ComboBox created as follows.

  • Now right-click on the ComboBox and select Properties.

  • After that, select the Alphabetic tab in the Properties window. Then make the following changes: AutoWordSelect >> False, Linked Cell >> B4, MatchEntry >> 2 – fnMatchEntryNone.

  • Now copy the following code.
Private Sub ComboBox1_Change()

ComboBox1.ListFillRange = "Dropdown_List"

Me.ComboBox1.DropDown

End Sub
  • After that, double-click on the ComboBox. This will take you directly to a new module in the Microsoft VBA window. Then paste the copied code in the blank module as shown below. Next press F5 to run the code.

Create a Searchable Drop Down List with Excel VBA

  • Finally, the searchable dropdown will work like Google Search.

Create a Searchable Drop Down List in Excel with VBA


Things to Remember

  • You need to deselect the Design Mode in the Developer tab to be able to type in the ComboBox.
  • Don’t forget to make sure that the absolute references are entered properly in the formulas.
  • Use CTRL+SHIFT+ENTER in case the array formulas are not working.

Download Practice Workbook

You can download the practice workbook from the download button below.


Conclusion

Now you know how to create a searchable drop-down list in Excel. Please use the comment section below for further queries or suggestions and also let us know if you have been able to do that yourself. Stay with us and keep learning.


Related Articles


<< Go Back to Create Drop-Down List in Excel | Excel Drop-Down List | Data Validation in Excel | Learn Excel

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.
Md. Shamim Reza
Md. Shamim Reza

Md. Shamim Reza, a marine engineer with expertise in Excel and a fervent interest in VBA programming, sees programming as a time-saving tool for data manipulation, file handling, and internet interaction. His diverse skill set encompasses Rhino3D, Maxsurf C++, AutoCAD, Deep Neural Networks, and Machine Learning. He holds a B.Sc in Naval Architecture & Marine Engineering from BUET and has transitioned into a content developer role, generating technical content focused on Excel and VBA. Beyond his professional pursuits,... Read Full Bio

5 Comments
  1. Reply
    Radmir Mullatagirov Jul 19, 2022 at 12:17 AM

    This was super helpful! Thank you so much, Shamim!

  2. Hi Reza,
    A great article that provides a solution which works.
    I have tried to set up several dropdown lists on a same sheet and the workbook seems less stable now (Excel crashes when I enter the first letters of an item in one of the search fields).
    Have you had similar behaviors? Would you know how to overcome this?
    Many thanks,
    Chris

    • Hi Chris, thanks for your query.

      You are facing the issue probably because the defined range is dynamic. Besides, you shouldn’t use the same defined range as the ListFillRange for multiple combo boxes. Rather you need to create a unique defined range for each of the combo boxes. You may try the following solution.

      First, change the source of the defined range named as Dropdown_List to =States!$E$5:$E$17.

      Then, enter the following formula in cell F5 in the States worksheet.
      =FILTER(B5:B17,ISNUMBER(SEARCH(Dropdown!G4,B5:B17)),”Not Found”)

      Next, create a new defined range and name it as Dropdown_List2 and enter =States!$F$5:$F$17 in the source field.

      Now, insert another ComboBox in the Dropdown sheet and link it to cell G4. Enter Dropdown_List2 as the ListFillRange for this ComboBox.

      After that, open the VBA window and replace the earlier code with the following one.

      Private Sub ComboBox1_Change()
      ComboBox1.ListFillRange = “Dropdown_List”
      Me.ComboBox1.DropDown
      End Sub
      Private Sub ComboBox2_Change()
      ComboBox2.ListFillRange = “Dropdown_List2”
      Me.ComboBox2.DropDown
      End Sub

      Finally, run the code and hopefully you won’t face the issue again.

  3. Thank you for the easy to follow instructions, for some reason when I follow these the search part of the drop down box doesn’t work. I am using this for a list that changes based on selection (once you select an item it is removed from the list) and that is handled in the database. The name I am using is set to a defined range, but inside that range the results change based on selections, thoughts on why the search functionality doesn’t work for me?

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo