Easy Way to Addd Spaces to End of Text

RR Guy

New Member
Joined
Sep 12, 2005
Messages
19
I have a couple thousand rows of data and in column "I" the Item# appears. The item # can be from 2 to 12 characters long. I need an easy way to add spaces to the end of any item# so that each cell has 12 characters total. Is there a way to do this? For example I have Item # 3B or 4CWF. I need to add 10 spaces to #B and 8 spaces to 4CWF.

Thanks for any help.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
You want the spaces at the END of the string?

Try

=A1&REPT(" ",12-LEN(A1))

If you want the spaces at the beginning, just reverse the concatenation..

=REPT(" ",12-LEN(A1))&A1


Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,256
Members
452,901
Latest member
LisaGo

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