+ Reply to Thread
Results 1 to 2 of 2

Formula to Break an Address into it's Parts

  1. #1
    Forum Contributor
    Join Date
    06-29-2008
    Location
    Grand Rapids, MI
    MS-Off Ver
    Office 2010
    Posts
    127

    Formula to Break an Address into it's Parts

    Hi,

    I'm looking for a formula to break an address into it's parts. There are just a couple variations, and there are comma's after everything item EXCEPT between the US State abbreviation and the ZIP code.

    85 Maple Street, P.O. Box 80427, Stoneham, MA 02180

    545 Hupp Avenue, Jackson, MI 49203

    I would hope to break it into columns that line up the states whether there is a second address line or not. Maybe an IF statement to count the commas, and if there are only two then it does one thing, if there are three it does another?

    End result desired:

    Address 1 Address 2 City State ZIP
    85 Maple Street P.O. Box 80427 Stoneham MA 02180
    545 Hupp Avenue Jackson MI 49203

    I hope this is clear!

    Thanks!

    Well, when it posted, it changed the spacing between the words for me, so my "example" isn't formatted correctly.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula to Break an Address into it's Parts

    try in a spare column say b

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1,",",""))=3,A1,SUBSTITUTE(A1,",",",,",2))
    drag down
    then once done copy col b/paste special values back over b
    then on b use data text to columns/delimited choose comma as delimited
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1