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

[Excel] How to Protect Multiple Excel Tabs with Different Passwords

Requirement:  I have an excel file with multiple tabs which is being updated monthly by many users. I want to create a password for each tab so that each user can only view and edit their own tab. Limitation : Protect Sheet Function in Excel is notoriously weak.  Solution : Use VBA code to set up password on each tab. Protecting Multiple Tabs with Different Passwords Let's say I have three teams which need to report their daily sales in one excel spreadsheet. The three teams are named Team Apple, Team Watermelon and Team Grapes. First, let's create a new tab for each one of them. 1. Add three new tabs and rename each according to the team name. 2. Create a column for 'Name', 'Item', 'Sales' and 'Date' for each team.  3. Click Visual Basic from the 'Developer' tab. 4. From Sheet 2 to Sheet 4, copy and paste the VBA code below: VBA Code: Private Sub Worksheet_Activate()     Dim strPassword As String     'On Error Resume Next          M

[Google Sheets] How to Create a QR Code

What is QR Code? Qr Code or "Quick Response" code is a type of barcode with embedded alphanumeric information that can be read and understood by mobile devices. What is the purpose of QR Code? QR Code   provides a convenient way to store and distribute information to enable the users redirect towards a website, access social media pages, download an app, make payments and do many other useful things with little effort. How to Create QR Code in Google Sheets? The sample below shows how to create a QR Code that enables easy access to a website. 1. Open the Google sheets and enter the link of the website. 2. Copy and paste this formula in the cell beside the website link: =IMAGE ("https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=" & A1) Note : A1 refers to the cell where the website link is located. Change according to the cell reference. 3. Click Enter . 4. The QR code will be generated. 4. Scan the QR Code using your phone by pointing the camera

[Excel] How to Remove Password in Excel

  If you know the password of your Excel file and you want to delete it, there are several ways on how to do it. Remove password from "Info" panel 1. Open the encrypted Excel file. 2. Enter the password and click OK . 3. On the upper left corner, click the File tab. 4. In the left-hand panel, click Info and Protect Workbook to open the drop-down menu. 5. Select Encrypt with Password and delete the password that appears in the text field. 6. Click OK . 7. Go to File menu and click Save . Remove password from the "Review" tab 1. Open the encrypted Excel file. 2. Enter the password and click  OK . 3. On the main ribbon menu, click the Review tab. 4. Click Unprotect Sheet and enter the password. 5. Select Protect Sheet and click OK without entering a new password. 6. Go to the File menu and click Save . Remove password using the "Save as" option 1. Open the encrypted Excel file. 2. Enter the password and click  OK . 3. Go to the File tab and select S