Excel Variable SUM Formula

Hi @SHAISTA,

r.Field -.> you need to give the correct data type of the column name.

if suppose the “Gross_Amount” column is string data type means need to change the data type.
Refer the below coded
OutputDT.AsEnumerable().Sum(Function(row) Convert.ToDouble(row.Field(Of String)("Gross_Amount")))

Regards,
Arivu

3 Likes