+ Reply to Thread
Results 1 to 13 of 13

Convert one column of Addresses into three columns when text to be grouped is not even

  1. #1
    Registered User
    Join Date
    01-10-2014
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    5

    Convert one column of Addresses into three columns when text to be grouped is not even

    Hi All,

    I have checked to see if this has been answered before and can not find an exact reply.
    My problem is that I have a combined column of address: Suburb, State, Postcode - which needs to be broken into three which not be done accurately using tet to column or fx - left mid or right.
    The issue is that the Suburb could be made up of one or two Words with a space between. So I can not separate using text to columns as in some cases the suburbs comprised of two words will put the second word in the "state" column. It can also not be done using Left, Right,Mid, as they number of characters differs in each line. Hope someone can help and apologies if its been explained elsewhere. Thanks!
    example problem with columns to text.jpg

    COMBINED ADDRESS SUBURB STATE?? POSTCODE?? POSTCODE??
    ALTONA NORTH VIC 3025 ALTONA NORTH VIC 3025
    BONDI NSW 2026 BONDI NSW 2026
    WOOLLOONGABBA QLD 4102 WOOLLOONGABBA QLD 4102
    TOOWONG QLD 4066 TOOWONG QLD 4066
    NOVAR GARDENS SA 5040 NOVAR GARDENS SA 5040

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Convert one column of Addresses into three columns when text to be grouped is not even

    can you upload your desired results
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Convert one column of Addresses into three columns when text to be grouped is not even

    assuming your data starts from a2 in
    B2 copy paste =LEFT(A2,FIND(" ",A2)-1) for stats name and drag down


    in c2 copy paste =MID(A2,FIND(" ",A2)+1,LEN(A2)-(LEN(B2)+LEN(D2)+1)) and drag down

    in D2 copy and paste =RIGHT(A2,LEN(A2)-FIND("@",SUBSTITUTE(A2," ","@",LEN(A2)-LEN(SUBSTITUTE(A2," ",""))))) for postal code
    Last edited by hemesh; 01-10-2014 at 04:33 AM.

  4. #4
    Registered User
    Join Date
    01-10-2014
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Convert one column of Addresses into three columns when text to be grouped is not even

    Hi Hemesh,
    I have attached the end desired end result. thank you for your reply!example problem with columns to text.jpg

  5. #5
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Convert one column of Addresses into three columns when text to be grouped is not even

    for states name use
    =IF(LEN($A2)-LEN(SUBSTITUTE($A2," ",""))>2,LEFT($A2,FIND("@",SUBSTITUTE($A2," ","@",COLUMN(B2)))),LEFT($A2,FIND("@",SUBSTITUTE($A2," ","@",COLUMN(A2)))))

    for states =MID(A2,LEN(B2)+1,LEN(A2)-(LEN(B2)+LEN(D2)+1)) and postal remains same as above
    do not change the column part and adjust the cell references $A2 to your actual references
    Last edited by hemesh; 01-10-2014 at 04:56 AM.

  6. #6
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Here and there
    MS-Off Ver
    Excel 2010
    Posts
    376

    Re: Convert one column of Addresses into three columns when text to be grouped is not even

    @ hemesh - the second formula that you suggested for cell C2 will give the results: NORTH, NSW, QLD etc (working down) but that is not the desired result. The places with the 2 first names e.g. Novar Gardens and Altona North are the problems here,

    @ oddypatrick - I have tried to create what you need but I am sure there are folks here much better than I who will give you better results. Anyway look at the attached.

    TEXT - STATES.xlsx


  7. #7
    Registered User
    Join Date
    01-10-2014
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Convert one column of Addresses into three columns when text to be grouped is not even

    Hi Hemesh,

    Thank you for sending through some macros.. they did not quite work however its very close.
    Attached is the excel spreadsheet showing the results of the first Fx you posted.
    I've just seen you next post, will that solve the problem?
    thanksExample address column separated to 3 columns.xlsx

  8. #8
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Convert one column of Addresses into three columns when text to be grouped is not even


  9. #9
    Registered User
    Join Date
    01-10-2014
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Convert one column of Addresses into three columns when text to be grouped is not even

    I think you might have accidently sent back my original file not your improved one..

  10. #10
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Smile Re: Convert one column of Addresses into three columns when text to be grouped is not even

    I mistakenly attached older one


    formulas are in your desired section


    Example address column separated to 3 columns.xlsx

  11. #11
    Registered User
    Join Date
    01-10-2014
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    5

    Smile Re: Convert one column of Addresses into three columns when text to be grouped is not even

    Hemesh & Ursal,
    That is Perfect! many thanks, I have spent 4 hours today reading, watching youtube and trying to work it out myself..you have both helped me enormously in half an hour.

    This was my first time ever! using a forum.. and I wish I had joined 10 years ago.


    Just Fantastic!

  12. #12
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Convert one column of Addresses into three columns when text to be grouped is not even

    You are welcome oddy ! if your query is solved mark it as solved
    go to thread tools and select mark as solved

  13. #13
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Here and there
    MS-Off Ver
    Excel 2010
    Posts
    376

    Re: Convert one column of Addresses into three columns when text to be grouped is not even

    Form one aussie to another - you're welcome mate! Cheers

+ 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. Replies: 0
    Last Post: 04-11-2013, 04:42 PM
  2. Replies: 2
    Last Post: 09-19-2012, 10:58 PM
  3. Convert names and addresses from columns to rows
    By nathan85 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-19-2010, 01:22 AM
  4. [SOLVED] How to convert columns of data to one column of text
    By devlkat in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-06-2005, 12:06 PM
  5. Convert entire columns of text email addresses to hyperlinks
    By TSA in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-20-2005, 01:06 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