+ Reply to Thread
Results 1 to 4 of 4

How to get rid of the city and state in the address?

Hybrid View

excel1212 How to get rid of the city... 09-07-2012, 02:41 PM
Ace_XL Re: How to get rid of the... 09-07-2012, 04:36 PM
excel1212 Re: How to get rid of the... 09-08-2012, 05:30 PM
Armando Montes Re: How to get rid of the... 09-08-2012, 09:14 PM
  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    2

    How to get rid of the city and state in the address?

    I have a big data that contain address with city and state. Sample as follows (please note there is only space between each word, no other special symbol):
    A1: 123 Furrows Rd Holbrook NY
    A2: 456 New State Hwy (Rt 44) Raynham MA
    A3: 789 Liberty Ave Brooklyn NY
    A4: 101 Broadway Newburgh NY

    How can I get rid of the city and state so that the cell A1 - A4 look like this:
    123 Furrows Rd
    456 New State Hwy (Rt 44)
    789 Liberty Ave
    101 Broadway

    Many many thanks!

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How to get rid of the city and state in the address?

    Try..

    =TRIM(LEFT(SUBSTITUTE(A1," ",REPT(" ",100)),100*(LEN(A1)-1-LEN(SUBSTITUTE(A1," ","")))))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    09-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How to get rid of the city and state in the address?

    Ace_XL, thank you very much! One more question, some of cities have 2 words. Such as:
    675 Broadway New York NY
    How can I get it to show as: 675 Broadway

  4. #4
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Mexico
    Posts
    200

    Re: How to get rid of the city and state in the address?

    Maybe:
    =LEFT(A2,LEN(A2)-LEN(TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",50)),100))))

+ 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