I've been stumped on this googlesheets problem and can't think of the best way to do this or I'm overthinking this.
Essentially if I have a list of values, I'd like to compare it to another list of values. And if they have the same values at any point, I'd like it to remove it from an updated list that's outputted into a new cell.
In my example, I have a list of fruits in column A, a different list of fruits in column B, and the difference between column A and column B is what I'd like to get in column C. Thanks for the help!
Edit:
Ah, I'ved tried using the unique function, but it would give me the unique values of both the lists. I've also tried using the filter function, but I'm not exactly sure how the criterion for the filter would work with a list of values
Best Answer
Here's a way to achieve this
EDIT : If you have a lot of values this is maybe a better solution :
Breakdown of the formula
VLOOKUP
:Vlookup
to see if there's a match between values inB
andA
. It returns the value when true, and an error when false.Iferror
to replace the error withtrue
.Filter
to keep only the relevant answers (when there's atrue
statement).Formula
COUNTIF
:Countif
there's the valueB
inA
: return0
= (False
) or1
= (TRUE
).-1
: now theFalse
values aretrue
andtrue
values arefalse
./!\ this doesn't work when column A contains duplicate : use
UNIQUE
to futur-proof the formula.