+ Reply to Thread
Results 1 to 5 of 5

Breaking Out State Code

  1. #1
    Registered User
    Join Date
    02-22-2007
    Posts
    24

    Breaking Out State Code

    Not sure if this is possible. I have about 600 records that have the entire address of a business in an indivudual cell. For example:
    A1= 1234 First St., Boston, MA 12345
    A2=4567 2nd St., New Youk, NY 12345

    Is there anyway to look at each cell and determine the state and have the sate inputted in the adajacnt cell? In other words B1=MA, B2=NY, etc. Bottom line is I'm trying to sort the list by the state code.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Breaking Out State Code

    Assuming each state is preceded by a comma then

    B1: =LEFT(TRIM(RIGHT(SUBSTITUTE(A1,",",REPT(" ",50)),50)),2)

  3. #3
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Breaking Out State Code

    see the sample attached.
    modytrane
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Breaking Out State Code

    Ah, do you always have 5 digits ? I wasn't sure !

    Ha! Nothing like offering a hideously over engineered solution on a Friday - oops!

  5. #5
    Registered User
    Join Date
    02-22-2007
    Posts
    24

    Re: Breaking Out State Code

    You guys are awesome.......thanks!!!!!

+ 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