Google Sheet: Filtering multiple values in a single cell

Viewed 635

I'm trying to filter a column and the result should contain both the word "biology" and "aqa".

I'm using this formula now:

=regexmatch(A:A, "biology|aqa"

But the result also contains words that have biology or aqa only like:

  • biology-a2-unit-1
  • biology-a2-unit-4
  • biology-alevel
  • aqa-alevel
  • alevel-aqa-unit-1

My expected result should have both "biology" and "aqa" only like:

  • biology-aqa
  • biology-aqa-a-level
  • biology-aqa-gcse
  • as-biology-aqa
  • aqa-biology-gcse
1 Answers

you are using | which is OR logic. but you need AND logic

=FILTER(A:A, REGEXMATCH(A:A, "aqa"), REGEXMATCH(A:A, "biology"))

0

Related