# Calculate the total of column using calculated column

Is it possible to get the total count of items within a column on another column in the same list using calculated column formula?

I researched a lot cant find any calculated column formula that would provide the sum of the all numeric value within a single column.

example:

``````column 1
1
5
8
2
3
6
``````

Looking for a formula that would show the total using calculated column, as I want reuse the total value for further calculation and using CSR it will only display the value but not sure how i can use in a new column to perform additional calculations.

``````        OnPostRender: function (ctx) {
var rows = ctx.ListData.Row;
var sum = 0;
for (var i = 0; i < rows.length; i++) {
var value = rows[i]["FieldInternalName"];
sum = +sum + +value;
}
}
``````

Can be condensed to:

``````        OnPostRender: function (ctx) {
var sum = 0;
ctx.ListData.Row.forEach(function(row){
sum += row["FieldInternalName"];
});
console.info(sum);
}
``````

You can then use JSOM or REST to write the value to another Field

I'm not 100% clear what you're asking, but if I've interpreted you correctly, you should be able to add separate column values together (i.e. =([Column 1] + [Column 2] + [Column 3]) etc.). You may have to convert to a numeric value if they are "Single Lin of Text" columns, and also check for empty values as well in this scenario.

If you're looking to add the values contained in a single column, I'm not sure that is possible in SP2010 or older. If this is SP2013 or SharePoint Online you can probably achieve it through the use of JavaScript and the JSLink property to create your own customised column but this will require development effort to achieve.

Hope this helps.

• First of all thanks for responding. CSR will show the total, but I want the data to feed as a field value in a column. Reason: Need to then perform further calculation against the field value with the other fields on the same list. I was looking at calculated column, but doesnt has any option to do a sum for value only in a column. So do you have any suggestion, wherein I want to show the percentage of items completed by having the count of the column that has the value completed and divide it against the total of items in the list. Jun 17, 2016 at 7:35

You may use client side rendering OnPostRender to sum up all the values of a particular column. Use the below code.

``````(function () {
var option = {
OnPostRender: function (ctx) {
var rows = ctx.ListData.Row;
var sum = 0;
for (var i = 0; i < rows.length; i++) {

var value = rows[i]["FieldInternalName"];
sum = +sum + +value;
}