+ Reply to Thread
Results 1 to 4 of 4

Formula(s) to Split Text String Across Columns Using Columns as Seperator

  1. #1
    Registered User
    Join Date
    07-26-2012
    Location
    Tetbury, England
    MS-Off Ver
    Microsoft 365 MSO
    Posts
    73

    Exclamation Formula(s) to Split Text String Across Columns Using Columns as Seperator

    Hi All,

    I have a query for you...

    I have a spreadsheet, and in Column C I have text strings of addresses e.g:

    Address Line 1, Address Line 1a, Town, City
    Address Line 2, Town, City
    Address Line 3, Address Line 3a, Town, City
    Address Line 4, Address Line 4a, Town, City
    Address Line 5, City
    Address Line 6, Address Line 6a, Town, City

    and so on...

    What I have then done, is in Column D I have added the formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is intended to identify how many columns I need for each address line, in the above sample that would be 4, 2, 4, 4, 2, 4.

    What I now want is a way of (using formulas) using the commas in the sentences to separate the text into the number of applicable columns.

    I hope this makes sense...

    I hope you can help!




    Chris

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Formula(s) to Split Text String Across Columns Using Columns as Seperator

    Do you know that there is a built in feature to do this ? On the "Data" tab there is a "Text to Columns" feature that will parse string to separate columns based on the delimiter you provide it ... in your case the delimiter is ","

  3. #3
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Formula(s) to Split Text String Across Columns Using Columns as Seperator

    Hello Chris
    Nimrod's answer is the simplest solution but if you have to use formulas to keep your original data the you could use a User Defined Function (UDF) for this, for example:

    Please Login or Register  to view this content.
    With your sample data in A1:A6 if would be:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Copied across and down. The number of columns would have to be done manually. You could do a calculation of the maximum with the following Array formula (entered Ctrl+Shift+Enter):

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Hope this helps.
    DBY

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula(s) to Split Text String Across Columns Using Columns as Seperator

    Enter formula in D2 copy across and then down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v C D E F
    1
    2 Address Line 1a, Town, City Address Line 1a Town City
    3 Town, City Town City
    4 Address Line 3a, Town, City Address Line 3a Town City
    5 Address Line 4a, Town, City Address Line 4a Town City
    6 City City
    7 Address Line 6a, Town, City Address Line 6a Town City
    8
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

+ 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. split string into multiple columns
    By bmccall17 in forum Excel General
    Replies: 8
    Last Post: 06-05-2015, 12:27 AM
  2. Using 'Text to columns' when value to split is derived from a formula
    By Aysha in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-03-2014, 06:49 AM
  3. [SOLVED] complex split string (delimit-text to columns)
    By EXLwiz in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-09-2014, 09:59 AM
  4. Replies: 2
    Last Post: 04-09-2014, 11:48 AM
  5. [SOLVED] Split text string into 5 columns
    By Desree86 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-14-2014, 10:07 AM
  6. Split String into many columns according to Format criteria
    By wali in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-23-2010, 01:50 AM
  7. Split text string to different columns
    By liarliar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2008, 09:13 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