How to Create a Search Box in Any Excel Document

Creating a search box in Excel can be a powerful tool to quickly locate information within large datasets. Here’s how to add one to any Excel document:
1.Open your Excel document and choose where you want your search box to be. This could be above your data set or in any convenient location within your spreadsheet.
2.Insert a Text Box by clicking on the “Insert” tab, then on the “Text Box” button under the “Text” group. Click anywhere on your worksheet to place the text box.
3.With the text box selected, go to the “Formula Bar”. Enter the following formula:
“`
=IF(ISNUMBER(SEARCH($A$1, A2)), A2, “”)
“`
(Replace A2 with the first cell of your data range and adjust $A$1 accordingly if your text box is linked to another cell.)
4.Now press Enter. You won’t see any changes yet since you have not searched for anything.
5.Click on a cell where you want the results to show up when you search. Go back to the “Formula Bar” and enter the following array formula (You will need to press Ctrl + Shift + Enter if you are not using Excel 365 or later versions):
“`
=IFERROR(INDEX(DataRange, SMALL(IF(ISNUMBER(SEARCH($A$1, DataRange)), ROW(DataRange)-MIN(ROW(DataRange))+1), ROW(A1)), COLUMN(A1)),””)
“`
Again, replace DataRange with the actual range of your data.
6.Drag this formula down several rows so that multiple results can be displayed if needed.
7.Protect your search formula cells by going to the “Review” tab and clicking on “Protect Sheet”. You can specify a password, then select what kind of actions users of the document can perform without unprotecting it.
Now you have an operational search box in your Excel document! Just type a keyword into the text box, and all relevant records that include that keyword will be listed beneath it. This allows for rapid searching through vast amounts of data without having to manually filter or scroll through rows.
Remember: With newer Excel versions like Excel 365 or Excel 2019, dynamic arrays make this task even easier because they automatically spill results into adjacent cells, eliminating the need for entering array formulas with Ctrl + Shift + Enter.

