+ Reply to Thread
Results 1 to 9 of 9

Split an Address in one cell into multiple cells using a formula

  1. #1
    Registered User
    Join Date
    02-08-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Split an Address in one cell into multiple cells using a formula

    Hi Guys,

    Sorry if this has been asked before but i cannot seem to find the answer.

    So here's the problem, i have a spreadsheet where the user enters an address in A1 as follows:

    123 Made up Lane, Pretend City, Fairyland, England, ZZ12 5TT

    and i need a formula to split this into multiple cells based on where the comma's are.

    I can't use text to column thingy or a macro but need a formula because the address will change on multiple occasions. The problem is that each part of the address will not be constant between addresses and there may be 6 different 'sections' (parts seperated by commas), there may only be 3 or any combination in between.

    Any help or pointers would be greatly appreciated.

    Thanks

    Martin
    Last edited by excelnovice2007; 09-08-2010 at 04:16 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,577

    Re: Split an Address in one cell into multiple cells using a formula

    If you do Text to Columns and Choose Delimited and then choose the comma as your delimiter, it would work for you (no matter how many commas). Is there a reason you don't want to do that?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Excel 2007 & 2003
    Posts
    2,912

    Re: Split an Address in one cell into multiple cells using a formula

    Try this one: suppose your data in column A1

    HTML Code: 

  4. #4
    Registered User
    Join Date
    02-08-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Split an Address in one cell into multiple cells using a formula

    Quote Originally Posted by ChemistB View Post
    If you do Text to Columns and Choose Delimited and then choose the comma as your delimiter, it would work for you (no matter how many commas). Is there a reason you don't want to do that?
    Hi

    The reason i don't want to use the Text to Colums is because i then need to link the result from the forumla to many other cells and can't have the end user having to 'Text to Columns' each time a new address is entered.

    I can't use a macro either unfortunately

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902

    Re: Split an Address in one cell into multiple cells using a formula

    If your address is in A1:

    =TRIM(MID(SUBSTITUTE($A1,",",REPT(" ",100)),1+(100*(COLUMNS($A$1:A$1)-1)),100))

    copied across as far as you need and down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  6. #6
    Registered User
    Join Date
    02-08-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Split an Address in one cell into multiple cells using a formula

    Quote Originally Posted by NBVC View Post
    If your address is in A1:

    =TRIM(MID(SUBSTITUTE($A1,",",REPT(" ",100)),1+(100*(COLUMNS($A$1:A$1)-1)),100))

    copied across as far as you need and down.
    This is exactly what i was looking for, many thanks for your help it really is appreciated!

  7. #7
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Excel 2007 & 2003
    Posts
    2,912

    Re: Split an Address in one cell into multiple cells using a formula

    suppose your data in coloum A1 :

    HTML Code: 

  8. #8
    Registered User
    Join Date
    01-26-2013
    Location
    Middle east
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Split an Address in one cell into multiple cells using a formula

    Quote Originally Posted by avk View Post
    Try this one: suppose your data in column A1

    HTML Code: 
    Hi there,
    This is so elegant... I was looking for something like this :-)
    Is there a way to paste the individual parts of the address/sentence horizontally instead of vertically?
    Assuming the text is in A1, I am looking for a solution to break the text into as many columns as needed, placing the individual text fragments in B1, C1, D1, and so on...

    Many thanks in advance

  9. #9
    Registered User
    Join Date
    01-22-2015
    Location
    Salzburg, Austria
    MS-Off Ver
    2010
    Posts
    1

    Re: Split an Address in one cell into multiple cells using a formula

    Hi There,

    an even more elegant and easy way to do this, is with that Add-In
    https://www.youtube.com/watch?v=6RYD_I9PwX8

    This Excel Add In splits addresses in seperate columns AND corrects (!!!) the data. Check out the video!

+ 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