How to load Excel data into a DataTable and calculate row and column sums?

Hi @ram_pv

dt.AsEnumerable.Sum(Function(r) r.ItemArray.Sum(Function(a) cint(a.ToString)))

gives Total Sum of rows the datatable

dt.Columns.Cast(of DataColumn).Select(Function(c) dt.AsEnumerable.Sum(Function(r) Cint(r(c.ToString)))).Toarray

Gives the columns count of datatable

cheers.

3 Likes