Skip to main content

[Excel] How to add zero before a number in Excel

Use Apostrophe

The easiest way to add zeros in front of numbers in Excel is to add apostrophe (‘) before zeros.



This automatically converts numbers into texts so you will see a green triangle at the top-left corner of the cell indicating an error. Click “Ignore error” to proceed.

Text Formatting

You can simply change the number format to text to keep the leading zeros in numbers. To do this, follow the instructions below:


1. Right-click on the cell(s) where you want to add the leading zeros.

2. Select Format cells.


                          


3. The Format Cells dialog box will appear. Select Text from the category options.

4. Click OK.


                          

Custom Formatting

If you don't want the data to appear as text and you want to keep the number value, you may apply custom formatting. To do this, follow the instructions below:


1. Right-click on the cell(s) where you want to add the leading zeros.

2. Select Format cells.


3. The Format Cells dialog box will appear. Select Custom from the category options.

4. Enter zeros in the "Type" box. In the "Sample" box above, it will show how the value will appear in the cell.

5. Click OK.


                                

Apply Formula

TEXT Function


Example:


Where:

B2 = cell number where to get the original value
0000 = string length or the number of digits of the new value

REPT Function


Example:

Where:

0 = value (zero) to be added
2 = number of values (zeros) to be added
B2 = cell number where to get the original value
                

CONCAT Function


Example:


Where:

0000 = number of values (zeros) to be added
B2 = cell number where to get the original value

Use Ampersand


Example:


Where:

000 = number of values (zeros) to be added
B2 = cell number where to get the original value

Comments

Popular posts from this blog

[Google Sheets] Linking Data to Cell Ranges, Sheets and Another Spreadsheet

Google sheets is part of Google Workspace that organizes data in columns and rows for reporting and data analysis. In this tutorial, you will learn how to link data within tabs, between multiple tabs and from one spreadsheet to another. Before you begin To get started, go to sheets.google.com and select "blank" to open a new blank sheet. Linking Data Below are the different ways to link data in google sheets: Linking within tabs Linking between multiple tabs Linking from one spreadsheet to another Linking data within tabs 1. Click anywhere on google sheets and type anything. 2. Right-click and select Insert link. 3. Click Select a range of cells to link. 4. The "Select a data range" box will appear. 5. Select another cell within a sheet where you want to link your data. 6. Click OK . 7. Verify the cell address before you click Apply . Linking data between mul...

Productive Laziness: Achieving More by Doing Less

This blog is created for people who use Microsoft 365 and Google Workspace at work so they can utilize these platforms to its full potential. It also aims to reach people who are new to this to help them leverage their skills in the workplace. Both services offer productivity tools that can automate repetitive tasks and processes to get things done faster with less effort and better quality. Read this blog to learn how we can be "lazy" and "productive" at the same time with the help of these applications.

[Power BI] Connecting SharePoint Excel File to Power BI (Web version)

Requirement : Auto-update of Power BI report when an excel file in SharePoint is updated. Assumptions : Power BI is already installed. User has general knowledge in SharePoint and Power BI. Level : Beginner Connecting SharePoint Excel File 1. Sign into  https://powerbi.microsoft.com . 2. On the Power BI homepage, click Get data located on the lower left corner of the page.  3. You will be given options where to get the data you will use in your report. Select  Files . 4. From the displayed options, select SharePoint - Team Sites. 5. You will be asked to enter the URL to connect to. Enter the root URL of the SharePoint site where the excel file you will use is saved. 6. The list of SharePoint folders will be displayed.  7. Select the excel file from the SharePoint list. Click Connect . 8. Click Import . 9. On the homepage, click Create and select Pick a published dataset. 10. Select the file that you want to use from the list and click Create . 11. You are now ready...