How to get match the value from sheet 1 to another sheet 2 and display with condition


I want to lookup “ABC” company name in the column F and display matching company ABC 's ID 124.

Can you please help me any simple steps available .?

@Krishnakumar_Vasudevan are you want to match only one value or whole company column

Hi @Krishnakumar_Vasudevan

u can try this assume
dt1 —> DataTable1
dt2 -----> DataTable2

dt3_Match= (From r1 in dt2.AsEnumerable Where dt1.AsEnumerable().Where(Function(row) row(“Company”).ToString.Trim.Equals(r1(“Company”).ToString)).Count=1 Select r1).CopyToDataTable

yes raja , can we iterate other company names in sheet 1 and search in sheet 2 to get appropriate ID values ?

So please apply these steps.
1-Dt1-> first datatable
2-Dt2-> 2nd datatable.
3- make DT3 through build datatable and give column name
Company and Id
4- put For Each loop over DT1
5 Inside Loop Put another For Each Loop over DT2.
6-put if in 2nd loop body and put condition
(Here row1 indicates DT1 and row2 indicates DT2)

7- put add row activity in If-then block and give the array to DT3 as {row1.item(“Company”).tostring, row2.item(“Id”).ToString}

Apply it otherwise I will send you file

1 Like

thanks , Could you please send me the file for reference.

@Krishnakumar_Vasudevan yeah I will send you when I will open my machine.

please check. I am attaching sample as well.
MatchColumns.xlsx (8.5 KB)
MatchColumns.xaml (11.4 KB)

Can we match row with column… If i have row name like skill in sheet 1 and having same name column skills … How we can comapare row with column