+ Reply to Thread
Results 1 to 6 of 6

Convert columns with Xs to comma delimited list

  1. #1
    Registered User
    Join Date
    10-30-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    7

    Convert columns with Xs to comma delimited list

    I have this data:

    Name 1 2 3 4
    Bob X X X
    Jim X
    Ned X X

    I need it to look like this:

    Name Values
    Bob 1,3,4
    Jim 3
    Ned 1,4

    I found a following formula, which works well for the first column. But I don't know how to customize to add the possibilty of more than one item in the list.
    =IFERROR(IF(SEARCH("*X*",H2,1),"1"),"No")

    Can you suggest a formula?

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Convert columns with Xs to comma delimited list

    With PowerQuery:

  3. #3
    Registered User
    Join Date
    10-30-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    7

    Re: Convert columns with Xs to comma delimited list

    Hi Sandy. The attached Excel file doesn't appear include any code. All I see is general text. Was I punk'd?

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,847

    Re: Convert columns with Xs to comma delimited list

    Hello ThumperStrauss and Welcome to Excel Forum.
    Here is a formula based option.
    1) Four helper columns (which may be moved and/or hidden for aesthetic purposes) are populated using: =IF(B2="X",COLUMN(A:A)&", ","")
    2) The column with values is populated using: =LEFT(F2&G2&H2&I2,LEN(F2&G2&H2&I2)-2)
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Convert columns with Xs to comma delimited list

    Quote Originally Posted by ThumperStrauss View Post
    Hi Sandy. The attached Excel file doesn't appear include any code. All I see is general text. Was I punk'd?
    It is PowerQuery so you'll need PowerQuery add-in for Ex2013 Pro Plus then you will see how it works (btw. code is inside PowerQuery - result is a data only)

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Convert columns with Xs to comma delimited list

    Try this, adapted from a solution developed by daddylonglegs on a similar sort of post from a day or two ago. DLL - imitation is the sincerest form of flattery!!

    =SUBSTITUTE(TRIM(SUBSTITUTE(TEXT(SUMPRODUCT(IFERROR(AGGREGATE(15,6,B$1:E$1/(B2:E2="X"),{1,2,3,4}),0),100^{3,2,1,0}),"00 00 00 00"),"00",""))," ",", ")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

+ 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: 9
    Last Post: 02-04-2016, 08:23 AM
  2. [SOLVED] Need A Macro that takes comma delimited values in select columns and seperates them to row
    By TroyBehmer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-19-2015, 08:16 PM
  3. [SOLVED] Data in Column A to Comma Delimited List
    By webdivx in forum Excel General
    Replies: 5
    Last Post: 07-11-2013, 02:16 PM
  4. Comma delimited list cell to new row code help
    By hoovopotamus in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-11-2011, 09:48 PM
  5. Button that creates delimited comma list
    By aegliveinterns in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2010, 08:48 PM
  6. Splitting comma delimited numbers into new columns
    By salmansohail in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-30-2010, 07:00 PM
  7. Splitting comma delimited numbers into new columns
    By Cicada in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-23-2009, 07:30 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