Fill formula help

EYEMDABEST

New Member
Joined
Oct 6, 2005
Messages
27
I have a spreadsheet that shows part numbers that are four and five digits. I have another that shows the same part numbers but is front filled with zeros. Is there a formula i can use to front fill with zeros the sheet that doesn't show them?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Change the format of the cells on the sheet you want to have padded with zeros. Under the "format cells" menu, click the number tab and choose custom. Then put 5 zeroes in the "type" box and that should pad your numbers up to 5 characters with zeros.

HTH
 
Upvote 0
Change the format of the cells on the sheet you want to have padded with zeros. Under the "format cells" menu, click the number tab and choose custom. Then put 5 zeroes in the "type" box and that should pad your numbers up to 5 characters with zeros.

HTH

This was my recommendation as well, just bear in mind that it won't actually change the cell contents, just the way they're displayed. For example, 123 will look like 00123, but when you look at the cell contents in the formula bar you'll still only see 123.

This will matter if you try to run a search for 00123 or build a formula based on cell contents.
 
Upvote 0
I have a spreadsheet that shows part numbers that are four and five digits. I have another that shows the same part numbers but is front filled with zeros. Is there a formula i can use to front fill with zeros the sheet that doesn't show them?
Does that mean you want all the part numbers to be 5 characters long?

Book1
AB
2123401234
31234512345
4345603456
52345623456
6999909999
71000010000
Sheet1

This formula entered in B2 and copied down as needed:

=IF(LEN(A2)=4,0&A2,A2&"")
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,862
Members
452,948
Latest member
UsmanAli786

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