Search code examples
google-sheetsfiltercomparedifferencegoogle-query-language

Compare two lists and print what is missing


I have two tables

  1. In list TEST22, which fruits did the buyer buy!

https://docs.google.com/spreadsheets/d/1wOZWSPapMTnLGco4POGjsO2nKPdCNIiD_TCsfFjegPs/edit?usp=sharing

In the TETS2 sheet, I want to select a buyer and display which puffs he did not buy

There is a table with all fruits

https://docs.google.com/spreadsheets/d/1u0k3gfDjyWJm3UZlCp3dm1T6QnrM9k3o_9W8nnrvhJo/edit?usp=sharing

How to make column C "What I didn't buy" display a list of fruits that the buyer did not buy ? It turns out to compare two lists and display what you didn’t buy

TRIED ={QUERY(.....) and not QUERY(...) ) but that doesn't work(

VLOOKUP won't work read data from left to right (


Solution

  • use:

    =FILTER(J2:J; NOT(COUNTIF(B2:B; J2:J)))
    

    enter image description here