How to Create a Searchable Table in Excel Using the FILTER Function

Published on

Finding specific records, or rows containing the required information, is straightforward in Excel using the Find command. But what if you want to extract those records dynamically? This is where the FILTER function combined with ISNUMBER and SEARCH comes in handy. With these tools, you can create a searchable table in Excel.

When creating a searchable table with the FILTER function in Excel, you may want to filter data from a specific column or search across the entire table. This guide will cover both scenarios.

Searchable Table with FILTER: Specific Column

Example Setup

For this example, we’ll use a simple table containing Product Name, Category, and Price in the range A1:C7.

Product NameCategoryPrice
LaptopElectronics750
SmartphoneElectronics600
Coffee MakerAppliances120
Hand BlenderAppliances50
Mixer GrinderAppliances130
Oven Toaster GrillAppliances200

In cell E1, type Search Term, and in F1, type Column #.

Enter the search term (e.g., Electronics) in E2 and the column number (e.g., 2 for Category) in F2.

In E4, enter the following formula:

=FILTER(
   A2:C7, 
   ISNUMBER(SEARCH(E2, CHOOSECOLS(A2:C7, F2))), 
   "No results found"
)
Example of a searchable table in Excel using the FILTER function to search within a specific column

Formula Explanation

FILTER Syntax:

FILTER(array, include, [if_empty])
  • array: The range to filter, in this case, A2:C7.
  • include: The condition used to filter rows.
  • if_empty: Custom message displayed when no results are found (e.g., “No results found!”).

Breaking Down the ‘include’ Argument:

ISNUMBER(SEARCH(E2, CHOOSECOLS(A2:C7, F2)))
  • CHOOSECOLS(A2:C7, F2): Returns the column specified by the number in F2.
    • For example, entering 2 in F2 selects the second column (Category).
  • SEARCH(E2, …): Searches for the term in E2 within the selected column.
    • Returns a number if the search term is found; otherwise, it returns an error.
  • ISNUMBER(…): Converts the result of SEARCH into TRUE (if a match is found) or FALSE.
  • FILTER: Filters rows where the condition evaluates to TRUE.

What Happens If No Match Is Found?

If the search term is not found, the formula returns the custom message “No results found!”.

Searchable Table with FILTER: Entire Row

Instead of searching a specific column, you might want to search across all columns in each row. This is useful when you’re unsure where the search term might be located.

Here’s the formula to filter rows by searching the entire table:

=FILTER(
   A2:C7, 
   ISNUMBER(SEARCH(E2, A2:A7&" "&B2:B7&" "&C2:C7)), 
   "No results found"
)
Example of a searchable table in Excel using the FILTER function to search across entire rows

Key Differences in This Formula

The ‘include’ argument concatenates all columns into a single text string for each row:

A2:A7 & " " & B2:B7 & " " & C2:C7
  • SEARCH checks for the search term (E2) across the combined row values.
  • ISNUMBER returns TRUE for rows where the search term is found.
  • FILTER extracts only the rows that match the search term.

For this approach:

  • Omit F1 and F2 (no need to specify a column number).
  • Enter the search term (e.g., “Electronics”) in E2.

That’s all about creating a searchable table with the FILTER function in Excel. Leave your feedback below, and feel free to suggest any additional improvements.

Resources for Further Learning

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Calculate Trip Days by Month (Start, End, and Full Days) in Google Sheets

If you're managing business travel in Google Sheets, you may need to calculate how...

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

More like this

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

Sort Each Row Individually in Excel Using a LAMBDA Formula

Sorting rows in Excel typically refers to rearranging entire datasets based on values in...

Sort by Field Labels Using the SORT and XMATCH Combo in Excel

Want to sort your Excel data by column names instead of column positions? Learn...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.