Inserting digits to a column of numbers?

J Lowe

New Member
Joined
Feb 17, 2002
Messages
27
I have a column of cells, about 6000 in all, that contain text based numbers, no formulas. The length of the number should contain six digits. The problem is that about half of these cells contain less than six digits.

I need to add zero's to the number to act as place holder's in those cells that do not contain all six digits.

Is there a way to add the zero to these cells without performing it manually?

For example:

B2750 has the number '98176', but I need it to be '098176'.

B4821 has the number '4498', but I need it to be '004498'.

And so on until I have single digit numbers.

Can anyone help me with this?

Thank you,
Jason
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I understand that you have text representation of numbers (e.g., "98176") that you want to be fixed-length (6 chars).
For values in column A enter the formula...

=REPT(0,6-LEN(A1))&A1

...and Fill down as needed. Use Copy/Paste Special Values to preserve the resultant values.
 
Upvote 0
Thanks to both of you for your responses.

I tried the first suggestion and it seemed to have worked. I'm glad to know it was something so simple. You guys are going to turn me into a pro, yet!

Thanks again,
Jason
 
Upvote 0

Forum statistics

Threads
1,214,540
Messages
6,120,107
Members
448,945
Latest member
Vmanchoppy

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