Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Splitting Address Info - Text to Columns

Hello-

Our database sends our adress info without specific delimters - ie
City_State_Zip (I know this should mean that it is delimted by a space but we
have several cities with a space in the name :) Is there a way to split
based on the text contained - ie everything before the first two cap
COmbination or Enter a specific state abrieviation etc?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Splitting Address Info - Text to Columns

On Fri, 12 Oct 2007 12:54:01 -0700, betany70
wrote:

Hello-

Our database sends our adress info without specific delimters - ie
City_State_Zip (I know this should mean that it is delimted by a space but we
have several cities with a space in the name :) Is there a way to split
based on the text contained - ie everything before the first two cap
COmbination or Enter a specific state abrieviation etc?


If the STATE is always a two letter abbreviation bounded by <spaces, and the
Zip is at the end with no included spaces, then you could use the following
formulas:

City: All words up to next-to-last <space

=LEFT(A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),
LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-1))-1)

State: The two characters following next-to-last <space

=MID(A1,1+FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),
LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-1)),2)

Zip: All the characters after the last <space

=MID(A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),
LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,255)


--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Splitting Address Info - Text to Columns

Beautiful - thanks!

"Ron Rosenfeld" wrote:

On Fri, 12 Oct 2007 12:54:01 -0700, betany70
wrote:

Hello-

Our database sends our adress info without specific delimters - ie
City_State_Zip (I know this should mean that it is delimted by a space but we
have several cities with a space in the name :) Is there a way to split
based on the text contained - ie everything before the first two cap
COmbination or Enter a specific state abrieviation etc?


If the STATE is always a two letter abbreviation bounded by <spaces, and the
Zip is at the end with no included spaces, then you could use the following
formulas:

City: All words up to next-to-last <space

=LEFT(A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),
LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-1))-1)

State: The two characters following next-to-last <space

=MID(A1,1+FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),
LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-1)),2)

Zip: All the characters after the last <space

=MID(A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),
LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,255)


--ron

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,091
Default Splitting Address Info - Text to Columns

Have your "database" send you the information, in a format acceptable to
Excel (or any other software). i.e. City, delimiter, State delimiter, etc
Almost all software is capable of creating delimited files.

Tyro

"betany70" wrote in message
...
Hello-

Our database sends our adress info without specific delimters - ie
City_State_Zip (I know this should mean that it is delimted by a space but
we
have several cities with a space in the name :) Is there a way to split
based on the text contained - ie everything before the first two cap
COmbination or Enter a specific state abrieviation etc?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Splitting Address Info - Text to Columns

On Fri, 12 Oct 2007 13:42:04 -0700, betany70
wrote:

Beautiful - thanks!


You're welcome. Thanks for the feedback.
--ron
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
Splitting Numeric data from Text (Street Address Help) Cameron Excel Discussion (Misc queries) 2 December 5th 06 10:18 PM
Splitting text, like "Text to columns", but as a formula Chris Glen Excel Discussion (Misc queries) 3 May 6th 06 07:21 AM
Splitting text to columns nospaminlich Excel Worksheet Functions 5 February 6th 06 09:26 PM
Splitting text in one column into two (or more) columns. RickyDee Excel Worksheet Functions 4 December 7th 04 10:03 PM
splitting text to multiple columns maryj Excel Discussion (Misc queries) 5 December 1st 04 03:37 PM


All times are GMT +1. The time now is 02:07 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"