Display Sum Total in SharePoint 2013 Online List View

This SharePoint customization tutorial we will discuss how to show sum total in SharePoint 2013/2016/Online list view by using out of box feature.

In this example, I have a SharePoint 2013/2016/Online custom list which has two Number fields as Age and Salary. The list looks like below:

show sum total in SharePoint 2013 online list view

Here I want to see a Sum of Age and Sum of Salary Column in the SharePoint list view.

Display Sum Total in SharePoint List View

For this Open the SharePoint list view in the browser, then go to List tab in the Ribbon and then click on Modify View like below:

show sum total in SharePoint online list view

This will open the Modify List view page. In this page navigate to the Totals page and expand that.

Then for the particular column choose Sum from the drop-down under Total. The option will come according to the column data type.

Let’s say Sum will appear for Numeric data type columns. But for single line data types column, Sum option will not appear.

It should look like below:

show sum total in SharePoint 2013 list view

Now click on OK and then you will be able to see the Sum in the list view like below:

show sum total in SharePoint list view

Remove Sum text from SharePoint 2013 Online List View using JavaScript

Now, we will see how to remove “Sum=” text from SharePoint 2013 list view. Here I have a SharePoint 2013 list where I have a Salary column. I am displaying the total Sum for the Salary column by following this article.

Here below to the Salary column, the sum is displaying as Sum=37,000.00. It displays like below:

Remove Sum text from SharePoint 2013

But my requirement is to remove the “Sum=” text, I just want to display the total sum.

Remove Sum text from SharePoint 2013 Online List View using JavaScript

Remove Sum text from SharePoint 2013 Online List View using JavaScript

This we can do by writing a simple JavaScript code. Open the SharePoint list view page then edit the page. In edit mode add a web part and choose script editor web part in SharePoint. Then put the below code inside the script editor web part.

<script type="text/javascript">

function hideSum(myString) {
var docTags;
docTags = document.getElementsByTagName("B");
for (var i=0; i < docTags.length; i++) {
docTags[i].innerText = docTags[i].innerText.replace(myString,"");
}
}

_spBodyOnLoadFunctionNames.push(‘hideSum("Sum=")’);
</script>

Now you will not able to see the Sum= text. It only shows the total sum.

This SharePoint tutorial explains, how to remove Sum text from SharePoint 2013 Online List View using JavaScript.

You may like following SharePoint customization tutorials:

This SharePoint 2013 tutorial explains, how to show sum total in SharePoint 2013/2016/Online list view.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>