How to Put a Search Box in Excel (Step-by-Step)
In this article
You can put a search box in Excel by adding a text box or a cell for the search term, then using the FILTER function (or AutoFilter for simple lists) to show only matching rows. The FILTER approach works in Excel for Microsoft 365 and Excel 2021 and later; for older versions, use AutoFilter or a helper column with SEARCH. No add-ins or macros are required for the basic version.
What You'll Need
- Excel for Microsoft 365, Excel 2021, or later for the FILTER function. If you have an older version, the AutoFilter method in Step 5 works instead.
- A table of data with a header row (for example, columns for Name, Department, and Email).
- An empty area on the same sheet or a new sheet for the search box and results.
Step-by-Step
- Format your data as a table. Select any cell in your data and press Ctrl+T (Windows) or Cmd+T (Mac). Confirm the range and that “My table has headers” is ticked, then click OK. A table makes ranges expand automatically and gives you named references. If you prefer not to use a table, select your data range and give it a name in the Name Box (left of the formula bar), for example DataRange.
- Create the search box. Click an empty cell where you want the box, for example cell F2. Type a label such as “Search:” in E2. Select F2 and add a light border or fill colour so it looks like an input field. You can also use Insert > Text Box and draw a box, but a cell is easier to reference in formulas.
- Write the FILTER formula. Click an empty cell below or beside the search box, for example F4. Enter: Replace Table1 with your table name and with the column you want to search. This returns only rows where the search term appears anywhere in that column. To search across multiple columns, combine conditions with + inside the include argument, for example .
- Test the search box. Type part of a name or value into F2 and press Enter. The formula spills results into the cells below and to the right. Clear F2 to show all rows again. If you see #CALC! or “No results”, check that the search cell is not empty and that the column reference matches your table header exactly.
- Use AutoFilter instead if you have an older Excel version. Select your header row and go to Data > Filter. Click the filter arrow on the column you want to search, choose Text Filters > Contains, type your term, and click OK. This hides non-matching rows rather than creating a live results list. To search all columns at once, use the Search box in the Filter drop-down (available in most recent versions) or add a helper column with
=ISNUMBER(SEARCH($F$2, A2&" "&B2&" "&C2))and filter that column for TRUE. - Make the search box easy to find. Freeze the top rows (View > Freeze Panes) if your search box sits above the data, or place it on a separate dashboard sheet. You can also add a data validation list to the search cell to offer suggested terms, but free typing is usually faster.
- Optional: add a clear button. Insert a shape (Insert > Shapes) and label it “Clear”. Right-click it, choose Assign Macro, and record a simple macro that clears the search cell. If you are not comfortable with macros, simply delete the search term manually.
Menu labels can differ slightly by Excel version, device, and region. The steps above are written for Excel on Windows; on Mac, Ctrl becomes Cmd and some dialog wording differs.
Common Mistakes
- Searching a fixed range instead of a table. If you use
A2:C100and later add rows, the search misses them. Use a table or a named dynamic range. - Forgetting wildcards in SEARCH. SEARCH already treats the search term as a substring, so you do not need asterisks. Adding them can cause unexpected matches.
- Case sensitivity. SEARCH is not case-sensitive. If you need case-sensitive matching, use FIND instead, but note that FIND returns an error when there is no match, so wrap it in IFERROR.
- Leaving the search cell blank. An empty search term makes SEARCH return 1 for every row, so FILTER shows everything. That is usually fine, but if you want a blank result when the box is empty, add an IF check around the formula.
- Overwriting spill results. The FILTER formula needs empty cells below and to the right. If those cells contain data, you will get a #SPILL! error. Clear the area or move the formula.
Tips
- Use
TRIMaround the search cell to ignore accidental leading or trailing spaces:SEARCH(TRIM(F2), ...). - For a search that matches whole words only, combine SEARCH with delimiters, or use AutoFilter’s “Equals” option instead of “Contains”.
- If your data is very large, AutoFilter is faster than a live FILTER formula because it does not recalculate on every keystroke.
- Keep the search box on a separate sheet if you want to protect the data sheet. The FILTER formula can reference another sheet without any special setup.
- Name the search cell (for example SearchTerm ) so formulas read more clearly: .
Troubleshooting
- #NAME? error: Your Excel version does not support FILTER. Use AutoFilter or the helper-column method in Step 5.
- #VALUE! error: The search cell or the column reference is not text. Check that you are searching a text column, or convert numbers to text with
TEXT. - #SPILL! error: The formula’s output area is blocked. Select the formula cell, press Ctrl+Shift+Arrow keys to see the spill range, and clear any cells in the way.
- No results even though the term exists: Check for extra spaces in the data (use TRIM in a helper column), confirm the column header spelling, and make sure the table name is correct (Table Design > Table Name).
- Search box does not update: Press F9 to recalculate, or check that calculation is set to Automatic (Formulas > Calculation Options > Automatic).
Frequently Asked Questions
Can I put a search box in Excel without macros?
Yes. The FILTER function and AutoFilter both work without macros. Macros are only needed if you want a one-click clear button or a custom dialog.
Does the search box work on Excel for Mac?
Yes, FILTER and AutoFilter are available on Excel for Mac in Microsoft 365 and Excel 2021 and later. Use Cmd instead of Ctrl for shortcuts.
Can I search across multiple columns at once?
Yes. In the FILTER formula, combine SEARCH conditions with + inside the include argument, or add a helper column that concatenates the columns you want to search and filter on that.
Why does my search show all rows when the box is empty?
An empty search term matches every row because SEARCH returns 1. If you want a blank result instead, wrap the formula in IF(F2="", "", FILTER(...)).
Can I search numbers as well as text?
SEARCH converts numbers to text automatically, so it works for both. For dates, format the column as text or use TEXT in the formula to avoid mismatches.
Is there a built-in search box in Excel?
Excel has Find (Ctrl+F) and the Search box in the Filter drop-down, but neither creates a persistent on-sheet search field. The method above builds one that stays visible and updates live.