+ Reply to Thread
Results 1 to 4 of 4

Create list from duplicate rows

  1. #1
    Registered User
    Join Date
    06-23-2017
    Location
    Keene, NH
    MS-Off Ver
    2017
    Posts
    6

    Create list from duplicate rows

    I'm trying to consolidate a list from data with duplicate rows. I'd like to have a horizontal list of colors that are associated with each animal. A "1" indicates an association in my example sheet. A comma delimited list of colors for each animal would be ideal. Let me know if you have any solutions.
    Attached Files Attached Files

  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: Create list from duplicate rows

    Is that what you want? (with PowerQuery) (if 2017 is real version of Excel - it means this is a Mac but Office for Mac doesn't support PQ)
    Attached Files Attached Files
    Last edited by sandy666; 10-18-2017 at 01:39 PM.

  3. #3
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Create list from duplicate rows

    If you have Excel 2016 (or better?) then there should be better options than the one I came up with (like sandy's, maybe? I'm stuck with Excel 2010), but the following should work with older versions. To return the animal in A34, the formula below should be array entered (confirm with Ctrl+Shift+Enter instead of Enter):

    =IFERROR(INDEX($A$2:$A$26,SMALL(IF(COUNTIF($A$33:$A33,$A$2:$A$26)=0,ROW($A$2:$A$26)-ROW($A$2)+1),1)),"")

    Fill down for the other animals. In B34 to get the colors:

    =SUBSTITUTE(TRIM(IF(SUMIF($A$2:$A$26,$A34,$B$2:$B$26)>0,$B$1,"")&" "&IF(SUMIF($A$2:$A$26,$A34,$C$2:$C$26)>0,$C$1,"")&" "&IF(SUMIF($A$2:$A$26,$A34,$D$2:$D$26)>0,$D$1,"")&" "&IF(SUMIF($A$2:$A$26,$A34,$E$2:$E$26)>0,$E$1,"")&" "&IF(SUMIF($A$2:$A$26,$A34,$F$2:$F$26)>0,$F$1,"")&" "&IF(SUMIF($A$2:$A$26,$A34,$G$2:$G$26)>0,$G$1,"")&" "&IF(SUMIF($A$2:$A$26,$A34,$H$2:$H$26)>0,$H$1,"")&" "&IF(SUMIF($A$2:$A$26,$A34,$I$2:$I$26)>0,$I$1,""))," ",",")

    Fill down for the others. This is not a very sophisticated approach, since it requires an IF clause for each color, but it does appear to work.
    Attached Files Attached Files
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

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

    Cool Re: Create list from duplicate rows

    I overlooked this
    Quote Originally Posted by ian2 View Post
    A comma delimited list of colors for each animal would be ideal
    . sorry

    but...
    (as I said before - PQ doesn't work with Mac)
    Attached Files Attached Files
    Last edited by sandy666; 10-18-2017 at 06:36 PM.

+ 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. Looking to create new rows with duplicate values
    By jewelr in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-07-2015, 01:44 PM
  2. [SOLVED] Macro To Create Duplicate Rows
    By air044 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-16-2014, 10:15 AM
  3. [SOLVED] Create Duplicate Rows
    By ignes in forum Excel General
    Replies: 5
    Last Post: 12-24-2013, 11:20 AM
  4. Create a list with duplicate values
    By nanoroboto in forum Excel General
    Replies: 1
    Last Post: 08-26-2011, 02:40 PM
  5. Macro to create duplicate rows
    By Q-D in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2009, 03:40 PM
  6. Create list that has duplicate entries
    By NMullis in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-14-2007, 03:07 PM
  7. Create a new list that singles out duplicate numbers
    By moglione1 in forum Excel General
    Replies: 1
    Last Post: 08-18-2005, 02:05 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