How to total up all values of a specific column to a single sum

Hello @MarcJo
use this code

DT.AsEnumerable().Sum(Function(r) if(r("A").equals(DBNull.Value) ,0,if(String.IsNullOrEmpty(cstr(r("A"))),0,if(r("A").tostring.contains(","),cdec(r("A").ToString.Replace(",",".")),cdec(r("A")) )))).ToString.Replace(".",",")

Again here The reason for error was blank values…What the above code does is converts the blank values to 0…

Check it and let me know about it

@vickydas worked perfect!
Thank you so much :pray:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.