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

Hi All,

Please find below excel sheet.

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 ?

Thanks in advance:-)

Hi @Vaishnav_Tej

Can you share the sample excel file?


Sample.xlsx (8.7 KB)

HI @Vaishnav_Tej

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

Check out this thread for Grade

How about this expression

(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)}
Select r = DtClone.Rows.Add(ra)).CopyToDataTable

Check out the XAML file

Total&AVG.xaml (7.4 KB)




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.


Could you please help

Have checked with this workflow? @Vaishnav_Tej

If you don’t have a very large amount of data and you know the structure of the table beforehand, then you can get away with simple counting and calculations using the UiPath activities for loops and conditions. To update totals in an Excel sheet, you need to know which data corresponds to which cells in the Excel sheet.
Use UiPath activities to write values to cells by providing the correct cell addresses on the worksheet.