Hello. I’m wondering how to get sum of one excel column? Do you know how can I get it?
Have you had the opportunity to review the following topic? Try to follow the steps, if you get an error, please let us know.
yourDataTable.AsEnumerable().Sum(Function(r) r.Field(Of Double)(“Column Name”))
yourDataTable.AsEnumerable().Sum(Function(r) r.Field(Of Integer)(“Column Name”))
Read the excel into a datatable and then try the below:
or you can use a for each loop to loop through the datatable and add each value to a variable, thus giving you the sum