+ Reply to Thread
Results 1 to 10 of 10

Separating Suburb and ZIP from addresses

  1. #1
    Registered User
    Join Date
    04-13-2013
    Location
    Calcutta
    MS-Off Ver
    Excel 2013
    Posts
    87

    Separating Suburb and ZIP from addresses

    Hello

    I have a spreadsheet (Excel 2007) with data in 3 columns; Name, Address & Phone

    Now the address field has the complete address in it, including the name of the suburb and ZIP code. I am looking for a quick way to separate the suburb and zip into individual columns. I tried Text-to-Column, but the address doesn't have any delimiter in the address, except for spaces. Splitting the address by spaces breaks it far and wide.

    So kindly advise me on what would be the best way to separate the Suburb and ZIP from the address into separate columns

    Sample from actual spreadsheet attached along with current state of data and desired output


    Many thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Separating Suburb and ZIP from addresses

    Try this... Zip:
    =IFERROR(--RIGHT(B3,4),"")

    Adress:
    =IF(ISERROR(--RIGHT(B3,4)),B3,LEFT(TRIM(SUBSTITUTE(B3,D16,"")),FIND("|",SUBSTITUTE(TRIM(SUBSTITUTE(B3,D16,""))," ","|",LEN(TRIM(SUBSTITUTE(B3,D16,"")))-LEN(SUBSTITUTE(TRIM(SUBSTITUTE(B3,D16,""))," ",""))))-1))

    Suburb:
    =TRIM(SUBSTITUTE(SUBSTITUTE(B3,D16,""),B16,""))

    HOWEVER, this will NOT work if the suburb has two words.... How often can that occur?
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    04-13-2013
    Location
    Calcutta
    MS-Off Ver
    Excel 2013
    Posts
    87

    Re: Separating Suburb and ZIP from addresses

    Hi Glenn

    Thanks a lot for your help.

    To answer your question first, there are quite a few addresses that don't have a ZIP in them. So that makes them two consecutive words without any numbers.

    Also, I am having a hard time understanding what's the best way to run this formula, as unlike the sample I provided, the actual sheet has a few thousand rows of data. So I was wondering if there is a way I could use a formula where I create a second Address column (besides the original one) along with suburb and zip columns and then use the formula in the second address column and it would automatically split up the address and fill up the corresponding, address, suburb and zip columns.

    Please see the attached spreadsheet to better understand what I mean

    I am sorry if this is too much to ask for. Just trying to figure out a way to run your formula in the best possible way.

    Thanks again
    Attached Files Attached Files
    Last edited by probuddha; 09-03-2015 at 04:14 AM.

  4. #4
    Registered User
    Join Date
    04-13-2013
    Location
    Calcutta
    MS-Off Ver
    Excel 2013
    Posts
    87

    Re: Separating Suburb and ZIP from addresses

    Hi Glenn

    I have figured out the way to run your formula in the way I desired, by changing the cell references.

    Just need to know how I can split those two worded suburbs


    Many thanks

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Separating Suburb and ZIP from addresses

    I have applied the previous solution to the sheet. It is NOT what you want yet....

    Am I correct in assuming that for 6/46 Hobill Ave Manukau Auckland 2104 you want it split as:

    6/46 Hobill Ave
    Manukau Auckland
    2104

    1) If so, I need you to provide me with as complete a list as possible of allowable address endings (Rd, St, Pl, etc)

    2) If not, then manually enter your expected results in columns C, D & E; and do 1) as well....
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-13-2013
    Location
    Calcutta
    MS-Off Ver
    Excel 2013
    Posts
    87

    Re: Separating Suburb and ZIP from addresses

    Quote Originally Posted by Glenn Kennedy View Post
    Am I correct in assuming that for 6/46 Hobill Ave Manukau Auckland 2104 you want it split as:

    6/46 Hobill Ave
    Manukau Auckland
    2104
    This would even be better


    1) If so, I need you to provide me with as complete a list as possible of allowable address endings (Rd, St, Pl, etc)
    I went through around 650 records and these are what appeared to be the ending of addresses

    Ave, St, Pl, Rd, RD, Dve, Cre, Ct, Way, Rse, Qy
    My expected results are in the spreadsheet attached. I actually need to break down the address into suburb, city and ZIP

    Many thanks
    Attached Files Attached Files
    Last edited by probuddha; 09-03-2015 at 08:51 AM.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Separating Suburb and ZIP from addresses

    Hi. Apologies for the delay!! I couldn't get logged into the forum, for some reason.

    I had just finished this, when I noticed that you had changed your requirement. I suspect that what you are asking for is impossible. If either the suburb, or the city can have more than one word - unless you have an exhaustive list of both, then there is no way that Excel can understand the rule by which to separate them. I have, however, completed your previous request. Can you live with this??
    Attached Files Attached Files

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Separating Suburb and ZIP from addresses

    C2=IF(ISERROR(--RIGHT(B2,4)),B2,TRIM(LEFT(SUBSTITUTE(B2," "," "),SMALL(INDEX(SEARCH({"Ave ","St ","Pl ","Rd ","Dve ","Cre ","Ct ","Way ","Rse ","Qy "},SUBSTITUTE(B2," "," ")&"Ave St Pl Rd Dve Cre Ct Way Rse Qy ")+3,0),SUM(INDEX((SEARCH({"Ave ","St ","Pl ","Rd ","Dve ","Cre ","Ct ","Way ","Rse ","Qy "},SUBSTITUTE(B2," "," ")&"Ave St Pl Rd Dve Cre Ct Way Rse Qy ")<=LEN(SUBSTITUTE(B2," "," ")))*1,0))))))
    Please Login or Register  to view this content.
    D2=TRIM(RIGHT(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,H2,""),K2,""),J2,""))," ",REPT(" ",100)),100))
    Please Login or Register  to view this content.
    E2=TRIM(RIGHT(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(B2,H2,""),K2,""))," ",REPT(" ",100)),100))
    Please Login or Register  to view this content.
    F2=TRIM(RIGHT(SUBSTITUTE(TRIM(SUBSTITUTE(B2,H2,""))," ",REPT(" ",100)),100))
    Please Login or Register  to view this content.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  9. #9
    Registered User
    Join Date
    04-13-2013
    Location
    Calcutta
    MS-Off Ver
    Excel 2013
    Posts
    87

    Re: Separating Suburb and ZIP from addresses

    Thanks Glenn and Siva for your replies. Sorry, I couldn't post earlier as I got busy with some other work.

    Glenn - your formula works fine. I realize that what I am asking for is a bit too much to be done through a formula. So the remaining data that could not be sorted through this formula, I could do that manually.

    Hi Siva - I haven't tried your formula yet. I will try it and let you know how it works.

    Thanks again, both of you, a lot

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,137

    Re: Separating Suburb and ZIP from addresses

    You're welcome...

+ 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. Postcode/Suburb Drop Down List
    By SmittyP in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-15-2012, 07:54 PM
  2. Sorting a messy database output by address suburb
    By coalman in forum Excel General
    Replies: 0
    Last Post: 09-13-2012, 12:48 AM
  3. enter suburb return with postcode
    By lpratt in forum Excel General
    Replies: 3
    Last Post: 04-12-2011, 02:50 AM
  4. Separating Addresses in EXCEL
    By artiststevens in forum Excel General
    Replies: 2
    Last Post: 03-05-2011, 02:35 AM
  5. separating company names and addresses
    By drquietus in forum Excel General
    Replies: 1
    Last Post: 06-06-2010, 04:26 AM
  6. Suburb and Postcode List
    By crania in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-06-2007, 09:25 AM
  7. Separating addresses into multiple cells
    By Rebecca in forum Excel General
    Replies: 1
    Last Post: 01-23-2006, 06:25 PM
  8. post code & suburb concatenate
    By varun in forum Excel General
    Replies: 3
    Last Post: 12-14-2005, 05:25 AM

Tags for this Thread

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