Search code examples
google-sheetsfiltertransposeflattengoogle-query-language

Exclude lines if ref and grade match in another sheets


It is the first time I am using Google sheet and I need to sort tables from two differents sheets. I want to keep only the ref that don't have a grade of A

here is a link in google sheet https://docs.google.com/spreadsheets/d/1quXkNuSYPF7MCs7_PGzjHKOLDf0TSvPqlEumNCWc0lc/edit?usp=sharing

February '22

February '22

March '22

March'22

Expected result (comparison between Feb and March)

Comparison

Thanks for helping


Solution

  • try:

    =QUERY({'February''22'!A:B; 'March''22'!A2:B}; 
     "where Col2 <> 'A' and Col2 is not null"; 1)
    

    or if you want only uniques:

    =UNIQUE(QUERY({'February''22'!A:B; 'March''22'!A2:B}; 
     "where Col2 <> 'A' and Col2 is not null"; 1))
    

    enter image description here