1

I have a set of data. There is a case where I have to exclude some data from the data set. Here is the sample case:

https://docs.google.com/spreadsheets/d/1WbsNoUg9b29Hqex55H7fHqzW2rdgm2aAVgy-Y9DTa4Q/edit#gid=0

  1. column A is the data set
  2. column C is the condition that needs to be excluded
  3. column E is the desired result

Is there any way of using Query to filter the data in column A that does not contain any string or value in column C?

Array formula or something that is similar is preferred since I do not need to drag down the formula again in the future

player0
  • 124,011
  • 12
  • 67
  • 124
Randy Adikara
  • 357
  • 3
  • 10

2 Answers2

0

You can set a filter that checks with REGEXMATCH if it contains any of the values in column C, and with NOT you exclude them:

=FILTER(A:A,NOT(REGEXMATCH(A:A,JOIN("|",FILTER(C:C,C:C<>"")))))

enter image description here

Martín
  • 7,849
  • 2
  • 3
  • 13
0

or:

=QUERY(A:A, "where not A matches '.*"&TEXTJOIN(".*|.*", 1, C:C)&".*'")

enter image description here

player0
  • 124,011
  • 12
  • 67
  • 124