+ Reply to Thread
Results 1 to 4 of 4

Splitting a Cell containg address

  1. #1
    Registered User
    Join Date
    03-23-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    1

    Splitting a Cell containg address

    My First post. Probably very simple for someone, sorry

    I have a Column of addresses with all information in the Cell - First Line of the Address, 2nd line - in some cases, Town, Post Code. All separated by commas.

    I want to create additional columns and place one element of the address in each new column

    Is it simple or not?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,778

    Re: Splitting a Cell containg address

    Is it simple? In theory, yes. In practice, maybe not so. You can use Data | Text to Columns witha comma delimiter. The issues arise when you find that some people have longer addresses than others, so the elements can be mis-aligned.

    But that's where you start.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Splitting a Cell containg address

    You can do this by counting the commas and then splitting.

    =left(a1,Len(a1)-find(",",a1))

    That will give you the first portion.

    The rest would be dependent on the number of commas. There's another recent thread with the syntax, though it was finding parentheses.
    Please remember to hit the Add Reputation for any member that has been helpful.

  4. #4
    Forum Contributor
    Join Date
    06-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: Splitting a Cell containg address

    Here's the formula from the other thread:
    =IF(LEN(B12)-LEN(SUBSTITUTE(B12,"(",""))=1,MID(B12,FIND("(",B12)+1,FIND(")",B12)-FIND("(",B12)-1),MID(B12,FIND("(",B12,FIND("(",B12)+1)+1,LEN(B12)-FIND("(",B12,FIND("(",B12)+1)-1))

    So you want something like:
    =if(Len(a1)-Len(substitute(a1,",",""))=4,mid(a1,find(",",a1)+1*,Len(a1)-find(",",a1,find(",",a1))),""**)

    * Assumes no space after your first comma. Change to 2 if there is a space.

    **Returns nothing when there isn't a second portion to address (suite, apartment, whatever).

    Obviously, remove the * before using. Adjust for additional columns as needed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Splitting an address from one cell into many cells (Australian Addresses)
    By Christopherdj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2011, 12:43 AM
  2. I can't remove periods (.) from a cell containg a name
    By dschmitt in forum Excel General
    Replies: 10
    Last Post: 03-14-2010, 09:00 PM
  3. Splitting Address From One Cell to Multiple
    By CoryShaw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-28-2008, 07:52 PM
  4. Address splitting
    By GordonJamieson in forum Excel General
    Replies: 3
    Last Post: 11-10-2006, 08:09 PM
  5. Splitting up address
    By Neal in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-20-2006, 03:15 PM

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