Need to get a particular Value a set of similar data

I have an excel which has several columns where specifically i have branch code in it, in which a particular branch have different persons but with similar branch mail. I need to get a single branch mail for a particular branch code but from several persons. I tried with several ways. How can i do it?


It’s better if you can share a sample input & Output excel


New Microsoft Excel Worksheet (2).xlsx (11.1 KB)
I have attached Sample data.

Hi @Monica_K69

you need distinct mail for distinct branch code right?

Yes i need a distinct branch mail. For example i have HN02 as branch code with two persons and branch mail is similar but i need a single branch mail for a branch to send mail to the branch.

@Monica_K69 If possible can you also share the output excel

@Monica_K69 Try the below exp. Check attached workflow

Variable of type Datatabel DT1 = DT.AsEnumerable.GroupBy(Function(x) x.Field(Of String)("BRANCHCODE")).Select(Function(g) g.First).CopyToDatatable
  • DT is the variable of type data table contains actual data
  • DT1 is the variable of type data table contains updated data (15.0 KB)



Check below for your reference

Hope this may help you