How to Create an Excel Search Box for Names and Details
Question details
The user wants to build a search interface in a spreadsheet to find specific names and display their associated details, like locations or contact info.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Managing a large dataset of names and needing a quick, automated way to look up individual records without manually scrolling through the entire worksheet.
- Observed behavior
- The user needs to set up a searchable field that actively pulls and displays related information from a separate table or dataset.
Ensure your data is organized in a clear, tabular format without merged cells, and that the names you want to search are listed in a single, consistent column.
Create a Search Box Using XLOOKUP or VLOOKUP Formulas
The easiest way to pull specific details based on a name search is by using lookup formulas. XLOOKUP is highly recommended for its flexibility and ease of use.
Lookup formulas can instantly return matching data from adjacent columns when a specific search term is entered into a designated cell.
Designate a specific cell (e.g., F2) where users will type the name they want to search for. You can highlight this cell or add a border to make it look like a search box.
In the adjacent cell where you want the detail (like Location) to appear, enter the formula =XLOOKUP(F2, A2:A100, B2:B100, "Not Found"). This assumes your list of names is in column A and the corresponding details are in column B.
Type a name into your search cell (F2) and press Enter. The detail cell will instantly update with the associated information or display 'Not Found' if the name isn't in your list.

Use the FILTER Function for Dynamic Search Results
If a name might appear multiple times or you want a partial match, the FILTER function is ideal for generating a dynamic list of results.
Create an Advanced Search Interface Using a VBA UserForm
For a polished, standalone search window similar to a software application, you can use Visual Basic for Applications (VBA) to program a custom UserForm.
Build Powerful Search Boxes Easily in WPS Spreadsheet
WPS Spreadsheet fully supports advanced array formulas like XLOOKUP and FILTER, as well as VBA macros, making it effortless to build custom search interfaces for your data without paying premium subscription fees.
- 1. Download and Install: Get WPS Office for free from the official website and open your existing Excel workbook in WPS Spreadsheet.
- 2. Set Up Your Search Field: Dedicate a clean, highlighted input cell for typing the name you want to look up.
- 3. Enter the Lookup Formula: Use built-in functions like =XLOOKUP() or =FILTER() to instantly pull associated details from your data table into your custom results dashboard.

Frequently Asked Questions
Why is my VLOOKUP search box returning an #N/A error?
The #N/A error occurs if the name typed in the search box does not exactly match any name in your dataset. Ensure there are no hidden spaces or typos. You can wrap your formula in =IFERROR() to display a customized message like "Name not found" instead of an error.
Can I create a drop-down list instead of a typing search box?
Yes, you can use Data Validation to create a searchable drop-down menu. Go to Data > Data Validation, choose "List", and select your name column as the source. This ensures users select a valid name, preventing typos and formula errors.
How do I search for a record across multiple worksheets?
While basic formulas usually look at one sheet, you can combine XLOOKUP with IFERROR to check multiple sheets consecutively, or use Power Query to consolidate the data into a single master table first before creating your search box.
Does the built-in Find tool work as a search box?
The built-in Find tool (Ctrl + F) will locate the cell containing the specific text and highlight it, but it does not extract and display the related details in a separate dashboard or custom interface like lookup formulas do.




