+ Reply to Thread
Results 1 to 3 of 3

Need formula to break up column

  1. #1
    Registered User
    Join Date
    04-13-2015
    Location
    QUEENSLAND, AUSTRALIA
    MS-Off Ver
    Excel 2007
    Posts
    14

    Question Need formula to break up column

    I posted yesterday, but I'm back with another issue. I need my document to look like this:

    Suburb State Postcode
    Surry Hills NSW 2011
    Maroubra VIC 3041

    At the moment however, it looks like this:

    Address
    Beverly Hills NSW 2076
    Bondi ACT 5607

    I can't use Text to Columns because then it would split suburbs that have two words up as well. Eg.

    Address
    Beverly Hills NSW 6033

    So, I need a formula that follows the following conditions:

    - If the cell has 4 words/pieces of text, then split the column after the second space
    - If the cell has 3 words/pieces of text, then split the column after the first space

    It should look like this:

    Suburb State/Postcode
    Alexandria NSW 1092
    Surry Hills VIC 1039

    Afterwards, I will just use Text to Columns to split up the State/Postcode box, so no need to worry about that. The end result should be the first table in my post.

    I appreciate any and all help - thanks!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need formula to break up column

    1) Enter formulas in this order:

    D1: =MID($A1, FIND("^",SUBSTITUTE($A1," ", "^", LEN($A1)-LEN(SUBSTITUTE($A1," ", ""))))+1,100)

    C1: =MID(TRIM(SUBSTITUTE($A1, D1, "")), FIND("^",SUBSTITUTE(TRIM(SUBSTITUTE($A1, D1, ""))," ", "^", LEN(TRIM(SUBSTITUTE($A1, D1, "")))-LEN(SUBSTITUTE(TRIM(SUBSTITUTE($A1, D1, ""))," ", ""))))+1,100)

    B1: =TRIM(LEFT(A1, LEN(A1)-LEN(C1)-LEN(D1)-2))

    2) Copy down as needed

    3) Select B:D

    4) COPY, the Paste Special > Values

    5) Remove column A.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-13-2015
    Location
    QUEENSLAND, AUSTRALIA
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Need formula to break up column

    Amazing, thank you so much.

+ 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. [SOLVED] Need formula/way to break up column
    By SM3T in forum Excel General
    Replies: 5
    Last Post: 04-14-2015, 12:27 AM
  2. [SOLVED] VBA to move to next column at each break - please help!
    By StephanieLilly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2014, 04:53 PM
  3. how to break out a new column from exising col.
    By bilter in forum Excel General
    Replies: 2
    Last Post: 01-20-2012, 10:45 AM
  4. Vertical Page Break / Column Break
    By kmg2424 in forum Excel General
    Replies: 0
    Last Post: 07-27-2010, 08:10 AM
  5. Break One Column into Five
    By nmlr in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-17-2010, 01:52 PM

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