Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2006

Tip: Looking for answers? Try searching our database.

Re: Separating addresses into multiple cells

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rebecca - 23 Jan 2006 21:22 GMT
I have been trying to separate addresses from 1 cell to multiple cells.
I have 500 to do, is there a quick way to go about it.
Example:

1234 S. West Street Indianapolis IN 46224

I need it to have the street name in 1 cell, City in another, State in
another, and Zip in another.  Thanks for your help.

Signature

Rebecca

Ron Rosenfeld - 23 Jan 2006 22:19 GMT
>I have been trying to separate addresses from 1 cell to multiple cells.
>I have 500 to do, is there a quick way to go about it.
[quoted text clipped - 4 lines]
>I need it to have the street name in 1 cell, City in another, State in
>another, and Zip in another.  Thanks for your help.

Most of this can be done with regular expressions.

The problem I run into is to define the delineation between street and city.

Zipcode is easy, its either ddddd or ddddd-dddd at the end of the line.

The State is easy, too.  It will be a two-letter string prior to the Zip code.

The City will be the string with the street, state and zip removed.

But Cities can be two words, or hyphenated.  And streets can be any number of
words.

You can come close with the following:

1.  Download and install Longre's free morefunc.xll add-in from
http://xcell05.free.fr

You can try the following formulas, with your string in A2

Zip:
E2:    =REGEX.MID(A2,"\d{5}(-\d{4})?$")

State:
D2:    =REGEX.MID(A2,"\b\w{2}(?=\s\d{5}(-\d{4})?$)")

Street: (This is the tough one; you may need to add some more options to the
alternation; if you do, note that each dot '.' must be preceded by a back
slash).  This won't get the streets that have just a name, though.  Like 166
Broadway.  But you should be able to pick them out as the street and city will
be merged into the city column; and the street field will be blank.

B2:
=REGEX.MID(A2,".*(St\.|Street|Ave\.|Avenue|Blvd\.|Boulevard|Place|Pl\.)")

City:  Just remove what we've already found:
C2:    =REGEX.SUBSTITUTE(A2,"\s?("&B2&"|"&D2&"|"&E2&")\s?")

--ron
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.