How to group data in Excel?

I have an excel that looks like this:

A 4
B 5
C 6
A 1
C 1
A 6

I want to group the data and give an output like

A total
B total
C total

Kindly help…

@arivu96 can u help me this this one??


Refer this

Hope this may helps you


1 Like

Hi @Srini84 this is not exactly what i wanted to achieve… as u can see the question just filters based on pass or fail but here i want to group based on the name so if there are 10 A’s and each has one value, i need an output like A [total sum of all other A’s]

i’m also trying alternate ways by myself but i’m a newbie so that’s y i posted to this forum…


Please use the LINQ query to get the work done. I have tested and working fine.

Please find the C# linq query. You can convert to VB.Net code.
Replace Column1 and Column2 in the below code.

DataTable newDt = dt.AsEnumerable()
              .GroupBy(r => r.Field<String>("Column1"))
              .Select(g =>
                  var row1 = dt.NewRow();
                  row1["Column1"] = g.Key;
                  row1["Column2"] = g.Sum(r => r.Field<int>("Column2"));
                  return row1;

Karthik Byggari


Hey @cybzom

You can also use the below custom activity to group the data in the datatable…

Use the consolidate Datatable activity which is bundled in this. You can also find a user guide in the component itself so that you can easily configure it.

Hi @cybzom,

Check this thread, this will definitely helps you.

Direct Link to Post with solution ist Here

How about pivoting the data in excel @cybzom ? :smiley:

In one excel sheet out of 10 columns i need to do these duplicates and sum in only 2 columns what about remaining 8 columns when printing

in this what is meaning of p

welcome to the forum

p is refering to the current looped datarow

Find some starter help on LINQ here:

hi Thanks for ur reply…I have one doubt in reframe work with out queus workflow. In that I want to combine different excel data by match and mismatch status. In get transaction I have to use string type variable for transaction item and array of string for transaction data but i am getting error whn i run the file .

please check

I have different excel fileslike this and in that 2 diffrent data is available and i have to check status of the 2 files … and I have to read total data