Excel Search Box (Table of Contents)
Search Box in Excel
A search box, in general terms, is a field or a text input space wherein a person can type a query and get results. For example, consider the case of a search engine like Google. We just type in the text that we are looking for and get a few results from which we can filter out and select the relevant ones. Similarly, in an Excel sheet also, we can create a search box. Let us try to understand how we can create a Search Box in Excel, the relevance of Search Box to us and its usage.
How to Create Search Box in Excel
Creating a Search Box in Excel is very easy and convenient when it comes to searching for rows or filtering data with a specific criterion. By using Conditional Formatting and Formulas we can easily create Search Box in Excel.
Let’s understand how to create your own Search Box in Excel.
Usage of Search Box in Excel
Consider that you have the data of a company that deals in the sale and purchase of used vehicles. The amount of data can be enormous and it can be difficult to search for a particular car model name from the entire data. A search box can prove to be a useful tool in such a case and help you in highlighting the values that you might be looking for.
To begin with, let’s consider data as shown in the screenshot below:
- In Excel, Go to the cell in which you wish to create the search box. In this case, we have selected G1 as the search box cell. You can highlight the selected cell in order to easily distinguish it from other cells.
- Now select the entire data range from where you want the data or the value to be searched. The selected range in our case is A2: D27 (as shown in the image below)
- Once you have selected the entire data range, go to Conditional Formatting, select New Rule.
- On the next window, click on the option that says, Use a formula to determine which cells to format.
After this, enter the following formula in the text box just below it.
- After writing the above formula in the space provided, click on the Format button just below it to select the color in which the searched (and matched) values will be highlighted.
This can be done by selecting the Fill button on the next window and selecting the color.
- After this, click on OK and you will see that all the fields in your sheet are now highlighted with the color that you selected. A screenshot of the same is also given below.
- Now you can try and search for the desired keyword and you will see that all the rows with the word that you have searched for are now highlighted with the selected color.
For example, let’s try searching the item named Scooter. You’ll see that all the rows with the word scooter have been highlighted.
This simplifies the process of looking for any value. For example, now after the fields for Scooter have been highlighted, we can simply apply a filter on the color and refine our search results even further. Now let us try to understand the meaning of the parameters that we used in the Search formula and how it worked for us in Excel.
Explanation of Search Box in Excel
Let us now try to understand what each parameter within the formula of Search means in Excel. Consider the formula that we used.
Let’s have look at each parameter individually.
This parameter defines the location where we wish to apply the search rule. We can either type in the cell number or we can simply click on the cell where we want the search box after we have written =SEARCH in the conditional formatting rule window.
This parameter, ‘A’ specifies the column from which data is to be searched and ‘2’ specifies the initial position. So ‘A2’ means that we wish to search for the data in column ‘A’ starting from the 2nd row. Adding $ sign before ‘A’ ensures that the search location remains fixed even if we change the location of the search box.
Affixing the ‘&’ sign after ‘A2’ means that we wish to add more locations from where data is to be searched. We can then specify all the search locations in the same manner as we specified for ‘A2’.
This can be seen in the formula:
Example of Search Box in Excel Usage
By now we have been able to develop a clear understanding of how to implement a Search Box in Excel. Now let us see some examples where we can use a search box and get refined results. Consider the previous example where we had searched for the word ‘Scooter’ in our Excel sheet and all the fields having the word ‘Scooter’ were highlighted. Now, what will we do if we wish to see the brand names of the Scooters that were sold in the year 2008?
Well, the answer to this question is quite simple. We can simply apply a filer now in the Year of Sale field. Let us have a look at the screenshot attached below.
We get the following result once we apply the filter and click OK. There are 2 brands whose scooter were sold in the year 2008 as shown below.
This is how a Search Box in Excel can help us in simplifying the search process.
We can even use filters to perform a search as we did above but then we would need to apply multiple filters in order to look for multiple things. Moreover, the example that we saw here had limited data. There may be cases when the amount of data present in a sheet is huge. A Search Box can help us in all such situation as it creates a search criterion for the entire sheet.
Things to Remember
- Make sure that you enter the formula correctly in the conditional formatting window.
- Use the $ sign as shown in the formula above to ensure that there is no deviation.
- The & sign is used to add more columns in the formula. Make sure that you do not put the & sign at the end of the formula.
- We can use a filter to solve the purpose of a Search Box in Excel but we may need to apply filters to several columns in order to solve that purpose.
- Though both, Search Box and Filters are used to fetch outputs based on various conditions, we should not use them interchangeably as both solve unique purposes and in different manners. A Search Box in Excel can be used to enhance the function of a filter.
This has been a guide to Search Box in excel. Here we discuss How to Create Search Box in excel and Usage of Search Box in Excel along with practical examples and downloadable excel template. You can also go through our other suggested articles –