Zero Fill a range of unique numbers

tl17339

New Member
Joined
Aug 8, 2018
Messages
10
Thanks for your advice. I have thousands of lines of unique 16 digit numbers. I would like to front zero fill digits 17 thru 20. Thanks again - Tom
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I have thousands of lines of unique 16 digit numbers.
You will need to store them as Text, because Excel will only never show more than 15 significant digits for numbers. Then you can use a formula:

A​
B​
C​
1​
Input
Output
2​
198003966751166700001980039667511667B2: =RIGHT(REPT(0, 20) & A2, 20)
3​
16002489689852000000160024896898520
4​
1573764205700000000015737642057
5​
3710898529759700000037108985297597
6​
862066000000000000008620660
 
Upvote 0
You will need to store them as Text, because Excel will only never show more than 15 significant digits for numbers. Then you can use a formula:

A​
B​
C​
1​
Input
Output
2​
198003966751166700001980039667511667B2: =RIGHT(REPT(0, 20) & A2, 20)
3​
16002489689852000000160024896898520
4​
1573764205700000000015737642057
5​
3710898529759700000037108985297597
6​
862066000000000000008620660

<tbody>
</tbody>
This formula in cell B2 will also work...

=TEXT(A2,REPT(0,20))

as will this one if you want to eliminate one of the function calls...

=TEXT(A2,"00000000000000000000")
 
Last edited:
Upvote 0
I don't think so:

A​
B​
C​
2​
0123456789012345600001234567890123450B2: =TEXT(A2,REPT(0,20))
 
Last edited:
Upvote 0
If all the numbers are 16 digits (as stated in post #1 ) and presumably formatted as text, all that is needed is :

="0000" & A2
 
Upvote 0

Forum statistics

Threads
1,214,785
Messages
6,121,543
Members
449,038
Latest member
Guest1337

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