HomeGoogle DocsSpreadsheetHow to Create a Simple Multi-Column Search Box in Google Sheets

How to Create a Simple Multi-Column Search Box in Google Sheets

Published on

A multi-column search box means a search box that can handle conditions in multiple columns. So such search boxes will definitely contain multiple search fields.

With the function Filter and Search, I am going to create a multi-column search box in Google Sheets. With this search box, you can search a table and filter the rows that contain the values you provide in the search fields.

Earlier I have shared an advanced single column search box.

I have used Query and some complex Query string comparison operators in that – How to Create a Search Box Using Query in Google Sheets. Personally, I like the Query search box.

In my real-life use, I have set up a search box using Query for a single column data that contains my 1500 (approx) post titles.

I find the search box very useful to search my said single column data in different ways. So that I can make sure that I am not repeating a title in my future posts.

But many users are looking for how to create a simple multi-column search box in Google Spreadsheets. I hope this tutorial will be useful to them.

How to Search a Table Using a Simple Multi-Column Search Box

First I’ll show you how the multi-column search box works in Google Docs Sheets. Then we can move to the tutorial section that details about creating it.

The below example demonstrates how a two-column search box works.

Multi-Column Search Box in Google Sheets

In this example, the search fields are in cell G2 and H2 which contains criteria for columns B and C respectively.

First I’ll demonstrate to you how the search field works. For that, I am going to use the Filter + Search combo in a single column.

Yep! Let’s begin with a single column search box.

Once learned you can create a multiple-column search box in Google Sheets hassle-free.

How to Use Filter and Search Functions to Search a Column

To filter a column or multiple columns, we can use the Filter function in Google Docs Sheets. There is Query too. But I am using the Filter function for the search box as it’s simple to learn.

Must Check: Google Sheets Functions Guide.

Then why am I using the Search function together?

To understand why I am using the Filter + Search function combo to create a search box, see the example below.

Filter search box and NA error

In the above example, my search field is cell C2 and the search key is “Fancy”.

Since the search key “Fancy” is not available, I mean as an exact match, the filter function in cell D2 returns the #N/A Error. Here is that formula.

Filter Formula:

=filter(A2:A,A2:A=C2)

In this the first argument A2:A is the data range, which means the data to be filtered.

The filter to be based on a condition. That condition is the second argument, i.e., A2:A=C2.

For partial match in Filter we can use the Search function as below.

Filter + Search Formula:

=filter(A2:A,search(C2,A2:A))

Results (Apple grades that contain the string “Fancy”)

U.S. Extra Fancy
U.S. Extra Fancy
U.S. Extra Fancy
U.S. Fancy

It would return all the rows wherever the string “Fancy” appears in Column A. So it’s up to you whether you want a partial match or exact match in the search box to consider.

Note: Here with the terms the exact match, I didn’t mean case sensitivity. I simply mean a full string match or partial match.

I am following the Filter + Search method in my two-column search box below (see the animated screenshot at the beginning of this post).

How to Create a Simple Two-Column Search Box in Google Docs Sheets

I have a four column dataset in the range A1:D and the two search fields are in the range G2:H2.

The Filter + Search Combo Formula in cell F5:

=filter(A2:D,search(G2,B2:B),search(H2,C2:C))
Steps to create a two column Search Box in Google Sheets

This is a perfect example to how to create a multi-column search box in Google Sheets.

If you are going for an ‘exact’ match, then use the Filter formula as below. No need to use the Search function.

=filter(A2:D,B2:B=G2,C2:C=H2)

You can add more columns, if you have more columns to filter.

Additional Notes

In search fields, i.e in the cells G2 and H2, you may use data validation to create a drop-box to select the criterion. So that you can either choose a criteria/condition from the drop-down to filter or tap the delete button to make the criterion blank.

A criterion that doesn’t appear in the search field may break-your filter. The drop-box helps us to avoid that.

You can make the above search box more advanced if you know the usage of Filter function well.

I mean you can filter based on multiple conditions in single columns, use comparison operators etc. The below Filter tutorials will be helpful for you in this direction.

  1. How to Use AND, OR with Google Sheets Filter Function.
  2. How to Use Date Criteria in Filter Function in Google Sheets.
  3. Regexmatch in Filter Criteria in Google Sheets.

I have given enough examples to help you create a multi-column search box in Google Sheets that may useful to meet your needs.

If you find the tips useful, take a moment to share this tutorial. See the social Share buttons below.

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.

Appointment Schedule Template in Google Sheets

An appointment schedule template in Google Sheets can assist you in efficiently managing your...

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

More like this

Appointment Schedule Template in Google Sheets

An appointment schedule template in Google Sheets can assist you in efficiently managing your...

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

15 COMMENTS

  1. Prashanth,

    Thanks for the Search Box tutorial. I’m facing an issue when multiple users open the Google Sheet and enter their desired search text in the search box: the results are not shown.

    The search works well when only one user is accessing the sheet, but not when more than one user is accessing the sheet. Is there a way to make the search capabilities work for multiple users at the same time?

    • Hi, Pete,

      I don’t know what is the issue. Please see the answer to Dave. I’ve provided him a link to another tutorial related to a multi-column search.

      If that doesn’t help, if possible, give me access to your sheet. I’ll try to solve the problem.

  2. Thank you for your help. I am trying to create a search bar for work and I have the formula working BUT I am not liking that when the box is empty where I am working I have all the results. Is there a way to get it so that the results only show up when there are works in the search box cell?

    • Hi, Moni Musial,

      Thanks for your valuable feedback!

      Regarding your query, we can do that by using an IF statement that involves Counta.

      =if(counta(G1:H2),filter(A2:D,search(G2,B2:B),search(H2,C2:C)),)

      This will only work if any of the cells in the criteria fields G1:H2 have any values.

      The below formula will only work if there are conditions in G2:H2. Giving only the field labels in G1:H1 is not enough.

      =if(counta(G2:H2),filter(A2:D,search(G2,B2:B),search(H2,C2:C)),)

  3. Hoping you still monitor this.

    I have about 7 columns I want to do Filter and Search across, but it seems the more search boxes I add, the more problems I get with the results, in that a number of results are missing.

    Does filter + search have known limitations like this, or if several search boxes are empty, it breaks down?

    • Hi, Dave,

      I’ve once again gone through the tutorial.

      I haven’t found any issue in the formula. But I have noticed one thing, i.e. you can leave any criteria field blank. But entering a criterion that’s not available in the corresponding column makes the formula breaks!

      To avoid that use the data validation drop-box in the search fields. So you can select a valid criterion.

      If you still have issues with the formula, please leave the URL of your sheet in the reply (which I won’t publish). So that I can have a look.

      In addition to the above, there is one more multi-column search box tutorial – Filter Rows if Search Key Present in Any Cell in that Rows in Google Sheets.

  4. Keep up the good work Prashanth and thank you. I have adapted formula for 10 columns and made my life so much easier.

    Amazing how little tricks make a massive difference.

    Cheers

    • How did you do that? When I more than 3 “search functions” within the filter(), I get an error that says:

      ERROR: FILTER RANGE must be a single row or column

  5. Hi,

    I currently created a google form that has the following fields: User, Period, lab, URL.

    I want to create a function that will allow me to filter into a NEW spreadsheet that holds all the users’ labs. So essentially I can view all the Labs from a User dynamically as they fill out the form.

    So if the user submits the form with a new lab it will add another column to their row. Can you suggest any articles/videos help me accomplish this?

    Thank you in advance.

  6. Hi,

    I’m trying to use the filter function but with a universal lookup value.

    Example: If A1 contains the lookup value then something like the following:

    =filter(C:C,D:D=$A$1,)OR(filter(C:C,E:E=$A$1,)

    At the moment I have the lookup value for different columns in different cells running an ‘if’ function. Check A1, if blank check A2, if blank check A3, etc.

    Any ideas on this?
    Thanks in advance!
    Josh

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.