is there any function that can delete or erase all numbers in a single column?

example: i want to erase all zeros(0)


and results should be:


  • Do they really need to be deleted from the Field Value, or are you fine when only in the View display they are replaced? Apr 27, 2017 at 8:37

1 Answer 1


It depends on what you need

Replace characters in the View or Form (SP2013/SP2016/SPO)

This can easily be done with CSR (Client Side Rendering)

  • User the Cisar WYSIWYG CSR editor
  • one simple function for use on Views/Forms

    var fieldvalue=ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
    return fieldvalue.replace(/0/g,'');

Replace characters in value (Calculated Column) (SP2003 - SPO)

SharePoint has no SUBSTITUTE function, and the REPLACE function only replaces ONE string instance

So all you can do is nest FIND & REPLACE and merge them into one Formula

(so Output_1 to Ouput_6 are not required)



Alas SharePoint can only nest 7 levels, so you can't merge Output_7 into Output_8

Output_8 needs to start from Output_7 Calculated Column (replace Input with Output_7 in the above Formula)

Hacky alternative, replace in View only

using JavaScript in a Calculated Column (SP2013,16,SPO - except Modern Experiences)

Provided you only need this in a View and can live with the (minor) sideeffects

You create only one Calculated Column, set to output as Number with the Formula:

="<img src=/_layouts/images/blank.gif onload=""{"
 &"var TD=this.parentNode.parentNode;"
 &"TD.innerHTML='" & Col &"'.replace(/0/g,'');"

This will rework Col every time it is displayed in a View, so you can't use the "Calculation" anywhere else.

Explanation and why JavaScript in a Calculated Column (in a VIEW!) works is here:http://www.viewmaster365.com/#/How

This is easier implemented than CSR, but CSR can do it for you on Forms as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.