Search code examples
regexgoogle-sheetsfiltergoogle-sheets-formulatextjoin

Google Sheet Filter excluding duplicates with condition


Having this example sheet (just sample data)

       Column-A      Column-B                    Column-C
  1    claudia       claudia@gmail.com           SOLD
  2    claudia       claudia@gmail.com           CONTACTED
  3    natalia       natalia@gmail.com           CONTACTED

How to use FILTER to filter row 3, that is to say: rows where colum-c is CONTACTED but excluding duplicated rows where one of the duplicated instances has "SOLD" within column-c.

Definition of "duplicate": same email (column-b)


Solution

  • try like this:

    =FILTER(A1:C, C1:C="contacted", 
     NOT(REGEXMATCH(B1:B, TEXTJOIN("|", 1, FILTER(B1:B, C1:C="sold")))))
    

    enter image description here