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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,215,068
Messages
6,122,950
Members
449,095
Latest member
nmaske

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