A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Discussion (Misc queries)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Inserting a space between characters in a cell



 
 
Thread Tools Display Modes
  #1  
Old April 23rd 10, 02:01 AM posted to microsoft.public.excel.misc
mrmnz
external usenet poster
 
Posts: 14
Default Inserting a space between characters in a cell

Hi

I have a column of codes and some are written as below:

A2ABC
A2BBB
A2CBC
A2DBD

I want them all to has a space after the A2 ie. A2 ABC, A2 BBB etc etc.

What is the best/easiest way to do this?

Thanks.
Ads
  #2  
Old April 23rd 10, 02:21 AM posted to microsoft.public.excel.misc
FSt1
external usenet poster
 
Posts: 3,942
Default Inserting a space between characters in a cell

hi
use a helper column off to the side. use this formula
=LEFT(A1,2)&" "&MID(A1,3,99)
adjust cell reference to fit your data.
copy down as far as needed.
copy the helper column and paste special values.
you can then replace the old data with the new.
regards
FSt1

"mrmnz" wrote:

> Hi
>
> I have a column of codes and some are written as below:
>
> A2ABC
> A2BBB
> A2CBC
> A2DBD
>
> I want them all to has a space after the A2 ie. A2 ABC, A2 BBB etc etc.
>
> What is the best/easiest way to do this?
>
> Thanks.

  #3  
Old April 23rd 10, 02:26 AM posted to microsoft.public.excel.misc
Ron Rosenfeld
external usenet poster
 
Posts: 5,651
Default Inserting a space between characters in a cell

On Thu, 22 Apr 2010 18:01:01 -0700, mrmnz >
wrote:

>Hi
>
>I have a column of codes and some are written as below:
>
>A2ABC
>A2BBB
>A2CBC
>A2DBD
>
>I want them all to has a space after the A2 ie. A2 ABC, A2 BBB etc etc.
>
>What is the best/easiest way to do this?
>
>Thanks.


You could use Find/Replace

Select the cells that start with A2
Find/Replace
Find what: A2
Replace with: A2<space>

You could use a formula:

=SUBSTITUTE(A1,"A2","A2 ",1)

On the other hand, if you always want to insert a <space> between the 2nd and
3rd characters, you could use:

=REPLACE(A1,3,0," ")

And if you always want to insert a <space> after the first digit, which might
or might not be in the second position:

=REPLACE(A1,MIN(FIND({1,2,3,4,5,6,7,8,9,0},A1&"1,2 ,3,4,5,6,7,8,9,0"))+1,0," ")

--ron
  #4  
Old April 23rd 10, 03:41 AM posted to microsoft.public.excel.misc
mrmnz
external usenet poster
 
Posts: 14
Default Inserting a space between characters in a cell

Thank you so much - it's worked just great.

"Ron Rosenfeld" wrote:

> On Thu, 22 Apr 2010 18:01:01 -0700, mrmnz >
> wrote:
>
> >Hi
> >
> >I have a column of codes and some are written as below:
> >
> >A2ABC
> >A2BBB
> >A2CBC
> >A2DBD
> >
> >I want them all to has a space after the A2 ie. A2 ABC, A2 BBB etc etc.
> >
> >What is the best/easiest way to do this?
> >
> >Thanks.

>
> You could use Find/Replace
>
> Select the cells that start with A2
> Find/Replace
> Find what: A2
> Replace with: A2<space>
>
> You could use a formula:
>
> =SUBSTITUTE(A1,"A2","A2 ",1)
>
> On the other hand, if you always want to insert a <space> between the 2nd and
> 3rd characters, you could use:
>
> =REPLACE(A1,3,0," ")
>
> And if you always want to insert a <space> after the first digit, which might
> or might not be in the second position:
>
> =REPLACE(A1,MIN(FIND({1,2,3,4,5,6,7,8,9,0},A1&"1,2 ,3,4,5,6,7,8,9,0"))+1,0," ")
>
> --ron
> .
>

  #5  
Old April 23rd 10, 04:40 AM posted to microsoft.public.excel.misc
Ron Rosenfeld
external usenet poster
 
Posts: 5,651
Default Inserting a space between characters in a cell

On Thu, 22 Apr 2010 19:41:01 -0700, mrmnz >
wrote:

>Thank you so much - it's worked just great.


Glad to help.
--ron
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Return cell characters after space Andy Excel Worksheet Functions 2 April 21st 10 10:25 AM
Trim Characters Other Than An Empty Space At The End Of A Cell K8_Dog Excel Worksheet Functions 5 April 19th 08 01:29 AM
Put A Space Between 2 right characters carl Excel Worksheet Functions 3 April 8th 08 05:08 PM
Count Characters with space in a cell NH Excel Discussion (Misc queries) 5 April 5th 07 05:07 AM
cHARACTERS BEFORE THE SPACE T De Villiers Excel Worksheet Functions 3 January 19th 06 01:22 AM


All times are GMT +1. The time now is 08:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.