How to find the sum by adding to list

Im attaching an excel I want to find the total of excel hours and punch hours .Can anyone please help me to solve this.
Excel_Time.xlsx (10.2 KB)

@Chippy_Kolot ,

Try this.

ExcelHour = (from r in inputDT.AsEnumerable where Double.TryParse(r.Item(“Excel Hours”).ToString,Nothing)=True).Sum(Function(x) cdbl(x(“Excel Hours”).ToString))

PunchHour=(from r in inputDT.AsEnumerable where Double.TryParse(r.Item(“Punch Hours”).ToString,Nothing)=True).Sum(Function(x) cdbl(x(“Punch Hours”).ToString))

1 Like


I see the format of few cells is different if all are numbers then you can use following

Dt.AsEnumerable.Sum(function(x) cdbl(x("ToTal Time").ToString))