Search code examples
regexgoogle-sheetsfiltergoogle-sheets-formulaimportrange

How to match and get non-matching records in cross sheets?


I have a Google sheet, my client also has another Google sheet. so I want to get entires from my client's sheet (Column B) which one does not match with my sheet (column B). How can I match and get non-matching values from my client's sheet to my sheet?


Solution

  • to get values from client's sheet, first run this formula:

    =IMPORTRANGE("client-sheet-ID", "sheetname!B2:B")
    

    then you can try:

    =FILTER(IMPORTRANGE("client-sheet-ID", "sheetname!B2:B"), 
     NOT(REGEXMATCH(IMPORTRANGE("client-sheet-ID", "sheetname!B2:B"), 
     "^"&TEXTJOIN("$|^", 1, UNIQUE(B2:B))&"$")))