+ Reply to Thread
Results 1 to 8 of 8

How to lookup a value in one column to create a comma separated list

  1. #1
    Registered User
    Join Date
    03-09-2017
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    15

    How to lookup a value in one column to create a comma separated list

    Here is a problem i often have and have never been able to figure out an answer to. Hoping someone here has run into the same problem and can help me out

    I have a big spreadsheet of data. Column 1 has the item number, Column 2 has the sku number and Column 3 has the color

    What im trying to do is create a comma separated list of values in a new column that would list all the colors of that specific Item No

    Here is a preview of what the spreadsheet may look like

    Column 1 Column 2 Column 3 ColorList
    Item1 Item1-Bk Black Black, Blue Green (this is what im trying to accomplish)
    Item1 Item1-Bl Blue
    Item1 Item1-Gr Green
    Item2 Item2-Bk Black
    Item2 Item2-Bl Blue
    Item2 Item2-Gr Green

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

    Re: How to lookup a value in one column to create a comma separated list

    Attach a sample workbook (not a picture!). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    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: How to lookup a value in one column to create a comma separated list

    Hi,

    The approach I usually use is
    D2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then in D3 copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then all that's left to do, in a helper column on row 2 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    where nn is the last row

    Now filter the helper column for the value 1, and copy the filtered rows and paste them as values somewhere.
    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.

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: How to lookup a value in one column to create a comma separated list

    Hi,

    Instead of a formula, here's a macro :

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  5. #5
    Registered User
    Join Date
    03-09-2017
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    15

    Re: How to lookup a value in one column to create a comma separated list

    here is what i hope is a sample wookbook
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-09-2017
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    15

    Re: How to lookup a value in one column to create a comma separated list

    Thanks @GC Excel

    That macro works perfect

  7. #7
    Registered User
    Join Date
    03-09-2017
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    15

    Re: How to lookup a value in one column to create a comma separated list

    Hey is there anything you could do in this macro to remove duplicate values for each sku. For example is SKU001 has the values of Blue, Blue, Black, Brown, is there a way to make it so it would only list Blue, Black, Brown?

  8. #8
    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: How to lookup a value in one column to create a comma separated list

    Quote Originally Posted by powersml07 View Post
    Hey is there anything you could do in this macro to remove duplicate values for each sku. For example is SKU001 has the values of Blue, Blue, Black, Brown, is there a way to make it so it would only list Blue, Black, Brown?
    Following on my earlier suggestion
    D2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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


    Copy D2:E2 down and filter colum E for the '1' values, then copy the filtered rows and paste somewhere as values.

    If you need a macro just encapsulate those steps in one.

+ 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. Help Creating a comma separated list based on a specific column
    By zach.shupp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-21-2014, 09:44 PM
  2. Macro to create a list of sheets, separated with comma in a single cell
    By manolomana in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-30-2014, 11:00 AM
  3. [SOLVED] exporting a column of data in excel to comma separated list in Word
    By momma_hav in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-20-2013, 04:33 PM
  4. Comma separated list with vertical lookup
    By tamxc4 in forum Excel General
    Replies: 0
    Last Post: 04-13-2012, 11:05 AM
  5. Replies: 6
    Last Post: 12-17-2011, 04:58 AM
  6. How to I create a comma separated values file
    By Ruby in forum Excel General
    Replies: 3
    Last Post: 07-30-2006, 02:02 AM
  7. 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