To add a search bar that filters a list as you type, put a search term in a cell and use Excel’s FILTER formula to show matching rows. For a quick search without a separate input cell, turn on a table’s built-in filter and type in its dropdown search box. The formula method requires Microsoft 365 or Excel 2021 or later; the built-in filter works in more Excel versions.
What You’ll Need
- An Excel workbook with a list arranged in columns, with one header row and no blank rows within the data.
- For the live search-bar method, Microsoft 365 or Excel 2021 or later, which supports the
FILTERfunction and dynamic arrays. - A blank cell for the search term and enough empty cells below and to the right of the results formula for matching rows to spill into.
If you only want to find something once, Excel’s Find command may be enough: press Ctrl+F on Windows or Command+F on Mac and enter a term. That searches the workbook but does not create a persistent search box that filters a displayed list.
Step-by-Step
- Arrange the source list. Put each kind of information in its own column and give every column a clear header. For example, use Item, Category, and Stock in A1:C1, with one product per row beneath. Avoid merged cells, blank header cells, and completely blank rows inside the list; these can make filtering and range selection unreliable.
- Convert the list to an Excel table. Click any cell in the list, then select Insert > Table. Check that the displayed range covers the entire list and that My table has headers is selected. Choose OK. Tables make it easier to manage and extend a list, and they provide built-in filter controls. On Mac and Excel for the web, the command may appear in a similar Insert menu; if the dialog offers the headers checkbox, make sure it is selected.
- Give the table a useful name. Click inside it and open the Table Design tab on Windows. In the Table Name box, replace the default name with
Inventory, then press Enter. On Mac, select the table and look for the table-design or Table tab and its table-name field. Naming the table is optional for Excel’s built-in search, but it makes the formula below easier to read. Table names cannot contain spaces. - Choose a cell for the search input. In E1, type Search items. In E2, leave the cell blank for now; this is where you will type a word or part of a word. You can add a fill color or border with the Home tab to make E2 look more like an input box, but the formatting is only visual. The cell itself is the search control.
- Set up a separate results area. Choose an empty area outside the source table, such as G3:I3 for headings and G4 for results. Type the same headings there—Item, Category, and Stock. Keep the cells below and to the right of G4 clear, because Excel needs that space to display the matching rows. Do not put the formula inside the source table: its results need room to spill, and a table does not allow a dynamic array to spill within its body.
- Enter the search formula. With the source data in the table named Inventory, its columns named Item, Category, and Stock, and the search term in E2, enter this in G4:
=FILTER(Inventory,ISNUMBER(SEARCH($E$2,Inventory[Item]&" "&Inventory[Category]&" "&Inventory[Stock])),"No matches")
This searches across all three fields and returns the full row for each match. The dollar signs keep the search reference anchored to E2. If your table or headers have different names, change the table and column references in the formula to match exactly. The formula is for Excel 2021 or Microsoft 365; older versions do not support FILTER with spilling results.
- Check the output. With the example data, type apple in E2. Excel should show the rows for Apple Juice and Apple Slices, including their Category and Stock values. The search is not case-sensitive, so Apple and apple give the same matches. If E2 is empty, the formula returns all rows because an empty search term matches every row.
- Try a different term and keep the search area usable. Replace the contents of E2 with another word, such as drinks, to show rows whose item, category, or stock value contains that text. To clear the search, delete the contents of E2. You can add a note beside the input cell such as “Search item, category, or stock” so other people know what fields are checked.
Alternative: use the table’s built-in search. If you do not need a separate search cell or live results area, click in the table and select Data > Filter if filter buttons are not already visible. Open the dropdown arrow on the column you want to search, type a term into the search box at the top of the menu, and select or clear the listed results as needed. Choose OK to filter the table. Repeat in another column to add another filter. This hides nonmatching rows in the original list rather than producing a separate results list. The filter dropdown is available in current desktop Excel and Excel for the web, though its layout can vary slightly.
Common Mistakes
- Putting the formula inside the source table. A dynamic-array formula needs a clear spill area. Place it outside the table, with enough empty cells for its output.
- Leaving something in the spill area. A stray value, space, merged cell, or another formula can stop the results from appearing. Clear the space below and to the right of the formula before troubleshooting the formula itself.
- Using different table or header names. If your table is called Table1 or your column is called Product, references to Inventory[Item] will not work. Check the displayed names in Table Design and use the exact names in the formula.
- Expecting the formula to find only whole words.
SEARCHlooks for a sequence of characters anywhere in the checked fields. Searching for “tea” can match “Green Tea,” for example. It is case-insensitive and can return more results than an exact-match search. - Assuming a filter search creates a separate search bar. The built-in dropdown search filters the table in place and is tied to a particular column. Use the formula method if you want a visible input cell and a separate results area.
Tips
- Use a short instruction beside the input cell to say which fields the formula searches. This is especially helpful when the search covers several columns.
- Format the search cell with a border and a subtle fill color, and format the result headings to distinguish them from the source list. Do not merge the input cell with neighboring cells; merged cells can cause layout and formula spill problems.
- Keep the source list as an Excel table so new records are easier to add. The formula’s table references adjust as table rows are added, while the manually typed result headings remain in place.
- If the workbook needs to work in an older Excel version without
FILTER, use the built-in table filters instead. They let readers search and filter the list without relying on dynamic-array formulas. - Use Ctrl+F on Windows or Command+F on Mac when your goal is simply to locate text in a workbook, not to create a reusable filtered view.
Troubleshooting
- You see #SPILL!. Excel cannot place the results in the cells it needs. Clear any content in the output area and remove merged cells there. If Excel shows a warning icon, select it to see which cell is blocking the spill.
- You see #NAME? or the formula is not recognized. Check that you are using Excel 2021 or Microsoft 365 and that the function name is spelled
FILTER. Older Excel versions cannot calculate this formula. Use the built-in table filter instead if you cannot upgrade. - The formula returns “No matches” unexpectedly. Check for typing differences in E2, confirm the formula refers to the correct table and columns, and make sure the source cells contain the expected text. Because the example formula checks Item, Category, and Stock, a term may match any of those fields, including a number in Stock.
- New records do not appear in results. Confirm the new rows were added inside the Excel table, not just below it as ordinary cells. Click the table and check that the new row has table formatting; if necessary, use Table Design > Resize Table to include the added records.
- The dropdown search box is missing. Confirm that filters are enabled with Data > Filter, then open a column’s dropdown arrow. If you are using a very narrow window, widen the menu or Excel window to see its search field.
Frequently Asked Questions
Can I insert a search bar without using a formula?
Yes. Turn on the table filters and type a term into a column’s dropdown search box. That filters the existing rows in place. A separate live results area generally needs a formula such as FILTER in a supported Excel version.
Can the search bar check more than one column?
Yes. The formula in this guide combines Item, Category, and Stock before checking for the search term, so a match in any of those fields returns the row. Adjust the formula’s column references if your list uses different headers.
Can I make the search case-sensitive?
The example uses SEARCH, which is case-insensitive. If case matters, Excel’s FIND function is case-sensitive, but changing the function can affect how your formula behaves and should be tested against your data.
Does the search bar work in Excel for the web or on Mac?
The built-in table filter is available in current Excel for the web and Mac, although menus can look different from Windows. The FILTER formula is also supported in current Microsoft 365 versions on those platforms. If the formula is unavailable, use the table filter or check your Excel version.
Can I search for a number, such as a stock quantity?
Yes. In the example formula, the Stock column is included in the search text, so entering a number can return rows whose stock value contains those digits. For instance, searching for 18 can match a stock value of 18; it is a contains search, not a numeric range filter.
Related
- Inventory Spreadsheet: Simple Setup and Useful Tips
- Inventory List Spreadsheet Template: Build and Use One
- Google Sheets Inventory Spreadsheet: Setup and Tips
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Share a Private Calendar in OutlookTo share a private calendar in Outlook, open Calendar, choose Share Calendar, enter the recipient’s email address, select…
- Format Zero as a Dash in Excel with Custom FormattingTo show numeric zeros as dashes in Excel without changing the underlying values, select the cells, press Ctrl+1,…
- Budget Spreadsheet South Africa: Build a Rand-Based PlanA useful South African budget spreadsheet is a monthly Excel workbook that records income and spending in rand…
- Conditional Formatting in Spreadsheets: How It WorksConditional formatting in a spreadsheet automatically changes a cell’s appearance when its value meets a condition; in Excel…
- How to Create an Automatic Email Signature in OutlookTo create an automatic signature in Outlook, open the signature settings for your version of Outlook, write and…
- Google Sheets: Highlight a Row When a Checkbox Is CheckedYes. In Google Sheets, you can highlight an entire row when its checkbox is checked by applying conditional…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.