TransWikia.com

How to filter Google Sheets by multiple contains using AND

Web Applications Asked on January 17, 2021

I’ve searched for something similar but couldn’t quite duplicate based on some other posts.

Column F has data on which websites you have a login with.

Let’s say

F2 = Amazon, Facebook, Google, Twitter

F3 = Amazon, Google, Twitter

F4 = Amazon, Netflix, HBO

I want to filter the column to show all records that contain BOTH Amazon AND Twitter. So, the filtered results should show only F2 and F3.

2 Answers

Update based on your comment:

Use this as a custom filter formula:

=REGEXMATCH(F2,"(?i)Amazon.*Twitter|Twitter.*Amazon")

enter image description here

As a google sheets formula:

=FILTER(F2:F,REGEXMATCH(F2:F,"(?i)Amazon.*Twitter|Twitter.*Amazon"))

regex

Answered by Marios on January 17, 2021

There are many ways to do this. For simplicity's sake, I recommend this:

=FILTER(F2:F,REGEXMATCH(F2:F,"Amazon"),REGEXMATCH(F2:F,"Twitter"))

It should be easy to understand and add to as needed.

Answered by Erik Tyler on January 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP