Adding Spaces into a column

snoopsterg

New Member
Joined
Sep 27, 2006
Messages
6
Guys,

You will probably know this and maybe think its easy, but i just cant think how to do this.

I have a column with sequential numbers twelve digits long, what i need is to either add a space after each 2 digits OR i need to move each set of 2 digits to its own column.

Am i just a bungling idiot or is this as difficult as i am making it for myself


Cheers for the help

Steve
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi, snoopsterg
Welcome to the Board !!!!!
move each set of 2 digits to its own column
see menu DATA / Text To Columns

in first box select option "fixed width" (don't know if this is correct english)
from there you can follow the instructions

kind regards,
Erik
 
Upvote 0
You could use these formulae in seperate cells

=MID(A1,1,2)
=MID(A1,3,2)
=MID(A1,5,2)
=MID(A1,7,2)
=MID(A1,9,2)
=MID(A1,11,2)

=MID('Cell containing 12 digits','starting digit','number of digits to take')

You could then concatenate the cells back together with spaces between.
 
Upvote 0
Thanks, will try that but it looks good, never thought of that simple is always best, and people like to call me simple


Steve
 
Upvote 0
Hi, Jamie,

if you want to concatenate them again, you could use a single formula
Code:
=MID(A1,1,2)&" "&MID(A1,3,2)&" "&MID(A1,5,2)&" "&MID(A1,7,2)&" "&MID(A1,9,2)&" "&MID(A1,11,2)
 
Upvote 0
Thanks for the reply both of you,

Both ways work except the first two columns that have got 01 and 03 in them, they both lose 0.

I have at the moment column A = 010312213041

when i use the either the text to columns or the =MID formula i have a problem to overcome.

with Text to columns i get

A B C D E F
1 3 12 21 30 41

so when i concatenate to add the spaces it misses 0 from 01 and the 0 from 03.

what i am doing is a mailshot with sequential lottery numbers for a draw so needs to be formatted with the zero
 
Upvote 0
Hi,

the "straight" option to get the zeros is to "follow the instructions" in the Text To Columns Dialog: in the last box there is an option "datatype per column"
choose "Text"

best regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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