Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 262
Default Splitting the contents of a cell

I have been given a list of hospitals in the UK. The format is:

The Royal Infirmary of Edinburgh [Edinburgh]

As you can see the city the hospital is located in is enclosed in square
brackets. What I want to do is split it so that the hospital name is in
column A and the City is in column B

Is there anyway to do this without having to manually go through each one.

Also the entries are hyperlinks, does this make any difference?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Splitting the contents of a cell

I do this.

Copy Column A into column B (insert a new column B if you need to)

Select column A:
edit|replace
what: _[* (underscore = spacebar)
with: (leave blank)
replace all

Select column B
edit|Replace
what: *[
with: (leave blank)
replace all

With column B still selected
edit|replace
what: ]*
with: (leave blank)
replace all



Keith wrote:

I have been given a list of hospitals in the UK. The format is:

The Royal Infirmary of Edinburgh [Edinburgh]

As you can see the city the hospital is located in is enclosed in square
brackets. What I want to do is split it so that the hospital name is in
column A and the City is in column B

Is there anyway to do this without having to manually go through each one.

Also the entries are hyperlinks, does this make any difference?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 430
Default Splitting the contents of a cell

Data....text to columns.... delimited
you might have to chose [ as a delimiter which will eliminate it from the
city but leave the ] at the end (which you could get rid of if you wished)



"Keith" wrote:

I have been given a list of hospitals in the UK. The format is:

The Royal Infirmary of Edinburgh [Edinburgh]

As you can see the city the hospital is located in is enclosed in square
brackets. What I want to do is split it so that the hospital name is in
column A and the City is in column B

Is there anyway to do this without having to manually go through each one.

Also the entries are hyperlinks, does this make any difference?

  #4   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Splitting the contents of a cell

Yet another way........
In B1 put
=LEFT(A1,FIND("[",A1,1)-2)

IN C1 put
=MID(A1,FIND("[",A1,1)+1,FIND("]",A1,1)-FIND("[",A1,1)-1)

Copy both down, and do Copy PasteSpecial Values on columns B and C and
then delete column A if you wish.........

Vaya con Dios,
Chuck, CABGx3



"Keith" wrote:

I have been given a list of hospitals in the UK. The format is:

The Royal Infirmary of Edinburgh [Edinburgh]

As you can see the city the hospital is located in is enclosed in square
brackets. What I want to do is split it so that the hospital name is in
column A and the City is in column B

Is there anyway to do this without having to manually go through each one.

Also the entries are hyperlinks, does this make any difference?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Splitting the contents of a cell

Text to Columns would not accept "[" as a delimiter so I did a find/replace
with a coma. Worked fine and then another find/replace with nothing to get
rid of the "]" on the end.

HTH
Regards,
Howard

"tim m" wrote in message
...
Data....text to columns.... delimited
you might have to chose [ as a delimiter which will eliminate it from the
city but leave the ] at the end (which you could get rid of if you wished)



"Keith" wrote:

I have been given a list of hospitals in the UK. The format is:

The Royal Infirmary of Edinburgh [Edinburgh]

As you can see the city the hospital is located in is enclosed in square
brackets. What I want to do is split it so that the hospital name is in
column A and the City is in column B

Is there anyway to do this without having to manually go through each
one.

Also the entries are hyperlinks, does this make any difference?





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Splitting the contents of a cell

Strange doings Howard.

Excel 2003 Text to Columns accepted the " [ "as a separator.


Gord Dibben MS Excel MVP

On Wed, 20 Sep 2006 13:46:57 -0700, "L. Howard Kittle"
wrote:

Text to Columns would not accept "[" as a delimiter so I did a find/replace
with a coma. Worked fine and then another find/replace with nothing to get
rid of the "]" on the end.

HTH
Regards,
Howard

"tim m" wrote in message
...
Data....text to columns.... delimited
you might have to chose [ as a delimiter which will eliminate it from the
city but leave the ] at the end (which you could get rid of if you wished)



"Keith" wrote:

I have been given a list of hospitals in the UK. The format is:

The Royal Infirmary of Edinburgh [Edinburgh]

As you can see the city the hospital is located in is enclosed in square
brackets. What I want to do is split it so that the hospital name is in
column A and the City is in column B

Is there anyway to do this without having to manually go through each
one.

Also the entries are hyperlinks, does this make any difference?



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Splitting the contents of a cell

Strange indeed! Tried it again and no problem.

Hmmm, I had checked Other and entered a [ and it would not show in the box,
tried several times and no go. But now all is fine.

Regards,
Howard

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Strange doings Howard.

Excel 2003 Text to Columns accepted the " [ "as a separator.


Gord Dibben MS Excel MVP

On Wed, 20 Sep 2006 13:46:57 -0700, "L. Howard Kittle"

wrote:

Text to Columns would not accept "[" as a delimiter so I did a
find/replace
with a coma. Worked fine and then another find/replace with nothing to
get
rid of the "]" on the end.

HTH
Regards,
Howard

"tim m" wrote in message
...
Data....text to columns.... delimited
you might have to chose [ as a delimiter which will eliminate it from
the
city but leave the ] at the end (which you could get rid of if you
wished)



"Keith" wrote:

I have been given a list of hospitals in the UK. The format is:

The Royal Infirmary of Edinburgh [Edinburgh]

As you can see the city the hospital is located in is enclosed in
square
brackets. What I want to do is split it so that the hospital name is
in
column A and the City is in column B

Is there anyway to do this without having to manually go through each
one.

Also the entries are hyperlinks, does this make any difference?





  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Splitting the contents of a cell

Thanks for the update.

JOOTT


Gord

On Thu, 21 Sep 2006 09:22:28 -0700, "L. Howard Kittle"
wrote:

Strange indeed! Tried it again and no problem.

Hmmm, I had checked Other and entered a [ and it would not show in the box,
tried several times and no go. But now all is fine.

Regards,
Howard

"Gord Dibben" <gorddibbATshawDOTca wrote in message
.. .
Strange doings Howard.

Excel 2003 Text to Columns accepted the " [ "as a separator.


Gord Dibben MS Excel MVP

On Wed, 20 Sep 2006 13:46:57 -0700, "L. Howard Kittle"

wrote:

Text to Columns would not accept "[" as a delimiter so I did a
find/replace
with a coma. Worked fine and then another find/replace with nothing to
get
rid of the "]" on the end.

HTH
Regards,
Howard

"tim m" wrote in message
...
Data....text to columns.... delimited
you might have to chose [ as a delimiter which will eliminate it from
the
city but leave the ] at the end (which you could get rid of if you
wished)



"Keith" wrote:

I have been given a list of hospitals in the UK. The format is:

The Royal Infirmary of Edinburgh [Edinburgh]

As you can see the city the hospital is located in is enclosed in
square
brackets. What I want to do is split it so that the hospital name is
in
column A and the City is in column B

Is there anyway to do this without having to manually go through each
one.

Also the entries are hyperlinks, does this make any difference?




Gord Dibben MS Excel MVP
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selectively Clearing cell contents jdd Excel Worksheet Functions 2 April 22nd 06 04:06 AM
Adding the contents of a cell to a formula Paul Bond Excel Discussion (Misc queries) 1 January 21st 06 07:19 PM
separating numbers and letters from alphanumeric cell contents PH Excel Worksheet Functions 10 September 3rd 05 12:15 PM
Conversion of Cell Contents into a Functional Worksheet name ? GMJT Excel Worksheet Functions 1 August 21st 05 04:59 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 10:52 AM.

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

About Us

"It's about Microsoft Excel"