Compare Two column of different excel file on it's uncommon item

I need to compare two column (B) of two different excel file to find the uncommon item of second file.


File A is main list
File B is partial list
i need the uncommon item of file A.

Thank you (56.4 KB)

Have a Look on the xaml from the Link below

Thank you for your reply but i don’t understand youre example :frowning:

the provided xaml showcases following:

on a first step we want to find the matches between dt1/2 related to a column (in this case column2)
dtCommon reflect all dt1 rows where column2 value is matched on rows in dt2

based on this we can calculate the rows from dt1 which are unmatched in dt2

dt1 is comparable to your case main list
dt2 is comparable to your case partial list
match column Column2 is comparable to your case Column B

So we do understand that the demo is reflecting your case.

As an alternate we can do it wothin a single statement (but with same defensive approach of handling empty result)

dtNonMatches =

(From d1 In dt1.AsEnumerable
Where Not dt2.AsEnumerable.Any(Function (r) r(1).toString.Trim.Equals(d1(1).toString.trim))
Select d1).toList

Give a try on it and let us know your open questions.