+ Reply to Thread
Results 1 to 7 of 7

Extract list - Comma separated

  1. #1
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Extract list - Comma separated

    Morning All

    I'm looking for a formula option only for this query.

    Excel 2010/2013

    I need to extract a list of single items from a comma delimited string in Column A, each item is always separted by a comma except when there's only 1 item in that string and in that case it will just be the item name with no delimter.

    I don't want to use text to columns as there's loads of manually faffing about

    The attached file will explains what I need

    Extract list comma delimited.xlsx

    Thanks

    Colin
    Excel Guru in the making

    <----------If the question has been answered to your satisfication please click the Add Repuation star to the left

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

    Re: Extract list - Comma separated

    see the attached file data was extracted with 2 supporting columns
    Attached Files Attached Files
    Samba

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

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extract list - Comma separated

    Or, if you want a solution without the use of helper columns, go to Name Manager and create the following:

    Name: Arry1
    Refers to: =1+LEN($A$2:$A$8)-LEN(SUBSTITUTE($A$2:$A$8,",",""))

    Name: Arry2
    Refers to: =MMULT(0+(ROW($A$2:$A$8)>=TRANSPOSE(ROW($A$2:$A$8))),Arry1)

    Exit Name Manager.

    The array formula** in your first cell of choice is then:

    =IF(ROWS($1:1)>SUM(Arry1),"",INDEX(TRIM(MID(SUBSTITUTE(INDEX($A$2:$A$8,MATCH(TRUE,Arry2>=ROWS($1:1),0))&",",",",REPT(" ",999)),999*(ROW(INDIRECT("1:999"))-1)+1,999)),IFERROR(1+ROWS($1:1)-LOOKUP(ROWS($1:1),1+Arry2),ROWS($1:1))))

    Copy down until you start to get blanks for the results.

    Regards

    Edit: note that this set-up requires that there are no blank cells within the range, which I took to be a fair assumption since you gave no indication otherwise and that indeed was the case with the example you posted.


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually inserat these yourself).
    Last edited by XOR LX; 07-28-2014 at 07:17 AM.
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Extract list - Comma separated

    Another option to achieve this is to take help of a VBA code. If you are open to a VBA solution to this, please find the attached sheet and click on the Green Button to generate the desired list.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: Extract list - Comma separated

    Thanks guys, all solutions work perfectly

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

    Re: Extract list - Comma separated

    Thanks for your feedback and adding the Reputation Mr/s. TheCman81

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Extract list - Comma separated

    You're welcome. Thanks for the feedback.

+ 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] Comma separated list of values help needed
    By handcoded in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 04-07-2014, 02:51 PM
  2. Comma separated list of values help needed
    By handcoded in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-07-2014, 11:41 AM
  3. [SOLVED] Formula to Extract Phrase in Cell to Comma Separated Text
    By ghoneim in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-04-2013, 09:44 AM
  4. Replies: 1
    Last Post: 07-24-2012, 04:13 AM
  5. Going from column to comma separated list...
    By jmboggiano in forum Excel General
    Replies: 1
    Last Post: 03-10-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