Add leading zeros in SharePoint calculated column

In this SharePoint Online tutorial, I will show you how to add leading zeros in SharePoint calculated column.

Here, I will create a SharePoint calculated column using the TEXT function and the CONCATENATE function to add leading zeros to a number using a SharePoint calculated column.

And also, I will add zeros to the end of the SharePoint calculated column using the TEXT function along with the REPT function.

SharePoint calculated column add leading zeros

Let’s see how to add leading zeros in SharePoint Online calculated column. To achieve it, follow the steps below.

  • Open a SharePoint Online list, click on the + Add column, select See all column types, and click on the Next button. Inside the Create column tab, enter the column name and choose The type of information in this column is (Calculated (calculation based on other columns)).
SharePoint calculated column add leading zeros
  • Then insert the formula in the Formula box by choosing the column from the Insert column and select The data type returned from this formula, then click on OK.

The formula used for this SharePoint calculated column is listed below.

=CONCATENATE("00",TEXT(ID,"0"))
Add leading zeros in SharePoint calculated column
  • Now, you can see the SharePoint Online calculated column is created and also shows the output of leading zeros in the SharePoint calculated column.
How to add leading zeros in SharePoint calculated column

This is how to add leading zeros in the SharePoint Online calculated column using the TEXT and CONCATENATE functions.

Add zeros to the end of a SharePoint calculated column

Here, I will show you how to add zeros to the end of the SharePoint calculated column. To do that, follow the steps below.

  • Go to the Create column tab using the same steps as the previous section, enter the column name, and choose The type of information in this column is (Calculated (calculation based on other columns)).
  • Then insert the formula in the Formula box under the Additional Columns Settings by choosing the column from the Insert column. Then, select The data type returned from this formula and click OK.

The formula used to add zeros to the end of the SharePoint calculated column is given below.

=TEXT([User ID],"0")&REPT("0",2)
SharePoint calculated column add zeros at the end

This is how to add zeros to the end of the SharePoint Online calculated column using the TEXT and REPT functions.

Conclusion

In this SharePoint tutorial, I have explained how to add leading zeros in SharePoint Online calculated column. Then I have shown how to add zeros to the end of the SharePoint calculated column.

You may like the following tutorials: