Add zeros preceding number so that number is a total of 6 characters

Sirod

New Member
Joined
Aug 6, 2009
Messages
47
Hello,

I have a list of product numbers of varying lengths - i.e. 2918, 5388, 37011, 47131, 765322, 872594. In a different list these same product numbers are preceded by zeros to make the number a total of 6 characters long. So in my second spreadsheet these same product numbers would appear as i.e. 002918, 005388, 037011, 047131, 765322, 872594. I need to format the product numbers in my first spreadsheet with the required number of preceding zeros. How do I do this quickly and easily? Please no VBA as I am not familiar with it.

Thanks.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
One easy way would be to create a formula like this (for an entry in cell A1):
Excel Formula:
=RIGHT("000000" & A1,6)
 
Upvote 0
On the off chance that the value in A1 could be more than 6 characters long, I would use this formula...
Excel Formula:
=TEXT(A1,"000000")
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top