+ Reply to Thread
Results 1 to 6 of 6

Split a column using comma delimiter

  1. #1
    Forum Contributor
    Join Date
    03-03-2011
    Location
    Ottawa, Ontario
    MS-Off Ver
    365
    Posts
    136

    Split a column using comma delimiter

    I have an address column that has everything separated with a column eg. street address, 2nd address (Apt etc.), city, state, zip code. I know how to separate them using the delimiter but some of the addresses don't include and 2 address so when I separate them the city ends up going into the 2nd address column and the other 2 are also in the wrong column. I am trying to find a way to get around this but I running into walls. Is there a way to insert a blank 2nd address with a comma if there isn't one in the original column? I've attached a sample of what it looks like and what I would like the output to be to give you a better idea as to what I need.

    Thanks for any help.
    Attached Files Attached Files
    Last edited by brent_milne; 10-09-2019 at 01:48 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Split a column using comma delimiter

    Process would be:

    Count the number of commas.

    If one Coma short, then replace the appropriate coma with two commas.

    Formula for C2

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by mehmetcik; 10-09-2019 at 01:26 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Contributor
    Join Date
    03-03-2011
    Location
    Ottawa, Ontario
    MS-Off Ver
    365
    Posts
    136

    Re: Split a column using comma delimiter

    That's what I was thinking of doing but I am not sure what the formula would be to achieve that.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Split a column using comma delimiter

    Try this

    Formula for C2

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

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Split a column using comma delimiter

    Hi,

    One way would be to regularise column B with the following in C2 copied down

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


    Then convert column C to values and use TextToColumns with a comma delimiter

    I assume B4 was a typo with a missing comma
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Forum Contributor
    Join Date
    03-03-2011
    Location
    Ottawa, Ontario
    MS-Off Ver
    365
    Posts
    136

    Re: Split a column using comma delimiter

    That worked perfectly, thanks very much for all your help.

+ 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. How to split a column at first delimiter only
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-07-2016, 08:32 AM
  2. [SOLVED] Split specific chars in one column to other columns with no delimiter
    By Fjalar in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-21-2013, 12:28 PM
  3. [SOLVED] split comma separated names in a column to a new column
    By letsxcel in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-16-2012, 10:45 AM
  4. [SOLVED] Split One Column at Delimiter While Copying Contents of Second Column to Populate New Rows
    By medailSacrosanct in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 08-01-2012, 11:37 AM
  5. Split comma seperated column in to new rows
    By singy33 in forum Excel General
    Replies: 1
    Last Post: 08-06-2009, 12:35 PM
  6. Split Column at comma
    By KarambaStar in forum Excel General
    Replies: 5
    Last Post: 04-11-2008, 12:45 PM
  7. Comma delimiter
    By Jon Quixley in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-25-2006, 11:50 AM

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