Filter Based on a List in Another Tab in Google Sheets

Here is a cool Filter function tip. You can learn now how to filter based on a list in another tab in Google Sheets.

You can make your Filter formula clean and readable by following my below tips and can learn some advanced Filter function use.

Do you know how to filter a dataset using criteria from a column range?

I mean, I want to use criteria in a Filter formula from a column range which can be from the same sheet tab or another sheet tab.

Please see the image below. The criteria list is in column E and the range to filter is the columns A and B.

filter using a list as criteria

It’s not easy to enter all the criteria within the formula because there are a total of 10 criteria aka conditions to filter. Also, it’s not suggestible as it can make your formula cluttered.

If you have 3-4 criteria, you can include it in the function very easily. I mean you can hardcode it as below.

=filter(A1:B,regexmatch(A1:A,"plum|cherry|papaya"))

But when it is very large, the better solution is to enter the criteria in a column and refer that column as criteria. Is this possible?

Yes! With the help of the REGEXMATCH function, we can do that easily.

Similar: Regexmatch in Filter Criteria in Google Sheets [Examples]

How to Filter Based on a List in Another Tab in Google Sheets

Master Filter Formula:

=filter(A1:B,regexmatch(A1:A,join("|",E1:E10)))

In my example above, the dataset (A1:B) and the criteria list (E1:E10) are on the same sheet. If the criteria list is in a different tab just include the Tab name with the range as usual.

Example:

Sheet2!E1:E10

Here in our Master Filter Formula, the range is A1:B and the criteria is the Regexmatch formula.

What does this Regexmatch formula do?

To understand that see a simple example. Suppose the value in cell A1 is “Inspired”. The following REGEXMATCH formula would return TRUE if any of the words “Info” or “Inspired” is present in cell A1.

=regexmatch(A1,"Info|Inspired")

In our main example above (mater filter formula), the criteria list is in the range E1:E10. The Join function joins all the criteria together and that separated by a pipe “|” symbol.

=join("|",E1:E10)

Output:

"apple|apricot|banana|blackberry|blackcurrant|blueberry|cherry|coconut|fig|grape"

The REGEXMATCH returns TRUE for all the matches and FALSE for the mismatch.

The Filter filters the TRUE values. That means all the values in the range A1:B filtered wherever it has a match in E1:E10.

Additional Tips

There is one unaddressed problem with the above formula. It’s the exact match.

For example, the Regexmatch formula used above can’t differentiate the word “pineapple” and “apple”. It considers both the same.

If you want an exact filter with several criteria as above, just change the formula as below.

=filter(A1:B,regexmatch(A1:A,join("|",("^"&E1:E10&"$"))))

Here what I have done is placed a Caret ^ symbol at the beginning of each criterion and a Dollar $ symbol at the end. It’s like;

^apple$|^cherry$

That’s all. Hope you have enjoyed this tutorial. Thanks for the stay.

Related:

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.

Hierarchical Numbering Sequences in Excel

Creating hierarchical numbering sequences in an Excel spreadsheet can significantly improve the way you...

How to Easily Repeat a Sequence of Numbers in Excel

Excel offers multiple ways to accomplish tasks, and the simplicity of each approach depends...

Create a Sequence of Dates at Every Nth Row in Excel (Dynamic Array)

Would you like to create a sequence of dates in every nth row in...

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

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.