How to sum all values in a column of an excel/Datatable?

Hi @lora,
Use this alternate lambda expression. I’m not an expert but I was able to understand this easily and put this into Studio quickly.

dt.AsEnumerable.Sum(Function(x) If(IsNumeric(x(“Column2”).ToString.Trim),CDbl(x(“Column2”).ToString.Trim),0))

sum is of type System.Double

Regards.

21 Likes