Match two excel sheets having row wise and column wise data respectively

I am having a situation where below shown datatable Sheet1 is matched with Sheet2 and the unmatched row of sheet1 should come in the Output sheet.

Please help me to provide a solution of this situation where matching of row wise data to be done with column wise data.

The excel file is attached here Match row vs column.xlsx (182.0 KB)

Sheet1 image

Sheet2 image

Output required image


Check below post for your reference

In your case if the row value is equal then place continue else break the loop and keep the conditions accordingly

Hope this may helps you


Thanks for reply @Srini84 but the shared video just describes how to check a value present or not but in my case i first have to match the column names and then its value accordingly i.e. if “A” column matches with “A” row then its value [True or False] matches or not. And it is going to work on around 6 columns matching.

How do i do that with the video link you gave .

If possible please share the workflow.


in general it can be fast prototyped with following approach:

  • create a controllist from dt2 2nd Column:
    dt2.AsEnumerable.Select(Function (r) r(1)).toArray

  • now it can be checked for filtering:

     (From d In dt1.AsEnumerable
     Where Not d.ItemArray.Skip(1).SequenceEqual(ControlList)
     Select d).CopyToDataTable

the first column from dt1 is ommited then it checks if all remaining items are in an equal sequence to the sequence of items in the controllist

If this check returns false, the row is used for the output.
FInd some starter help here:
MatchRowSet_vs_Columns.xaml (8.4 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.