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 Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Generate Unique Random Numbers in Excel with Dynamic Arrays

Unique random numbers refer to random numbers without duplicates. Generating such numbers is straightforward...

Lookup Previous Values Dynamically in Excel and Google Sheets

Sometimes, you may want to look up the previous values relative to the current...

Sort Data but Keep Blank Rows in Excel and Google Sheets

Using a dynamic array formula or the FILTER command, we can sort data and...

Lookup Values Under Categories in Excel and Google Sheets

We can use a combination of XLOOKUP and VLOOKUP in both Excel and Google...

More like this

Generate Unique Random Numbers in Excel with Dynamic Arrays

Unique random numbers refer to random numbers without duplicates. Generating such numbers is straightforward...

Extract Items Under a Category from the Same Column in Excel

In Excel, you can use a combination of the XLOOKUP and DROP functions to...

Time Sequences in Excel by Minute, Hour, or Second Increments

Creating time sequences, whether by hour, minute, or second increments in Excel, can be...

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.