# How to find student total, average and grade using DataTable activites?

Hi All,

I have to find the total, average and grade using DataTable activities. But i’m not understanding how to build the logic and which activities to use.
Could someone please explain me ?

Can you share the sample excel file?

Regards
Gokul

Sample.xlsx (8.7 KB)

Can you tell us how did you need to calculate the grade

Check out this thread for `Grade`

``````(From d In Dtread.AsEnumerable
Group d By k=d("Sno").ToString.Trim, k2=d("Sname").ToString.Trim Into grp = Group
Let sum = grp.Sum(Function (x) CDbl(x("Sub1").toString.Trim)+CDbl(x("Sub2").toString.Trim)+CDbl(x("Sub3").toString.Trim))
Let avg = sum/3
Let ra = New Object(){k,k2,grp.First()(2),grp.First()(3),grp.First()(4),sum,avg,grp.First()(7)}
``````

Check out the XAML file

Total&AVG.xaml (7.4 KB)

Regards
Gokul

Hello
which type of coding is that?
I didn’t understand anything.
Is it possible to make it simple ?
I have tried to get the total by adding 3 subjects using assign activity & converting it to int type. Now i’m stuck at updating the total values row by row in excel sheet using DataTable activity.