+ Reply to Thread
Results 1 to 7 of 7

How to combine rows where one column has duplicate value but other columns are unique?

  1. #1
    Registered User
    Join Date
    08-01-2019
    Location
    Calgary, Alberta
    MS-Off Ver
    16.27
    Posts
    5

    How to combine rows where one column has duplicate value but other columns are unique?

    See attachment for example case! Basically, I want to merge two rows in which one of the columns has duplicate information. However, the other columns are unique and I would like to keep this data.
    Attached Files Attached Files

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

    Re: How to combine rows where one column has duplicate value but other columns are unique?

    In B11:
    =IFERROR(INDEX($B:$B,AGGREGATE(15,6,ROW($A$4:$A$8)/($A$4:$A$8=$A11),COLUMNS($B:B))),"")

    and in E11:
    =IFERROR(INDEX($C:$C,AGGREGATE(15,6,ROW($A$4:$A$8)/($A$4:$A$8=$A11),COLUMNS($E:E))),"")

    for the second part, you'll need VBA. Is that OK??
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    08-01-2019
    Location
    Calgary, Alberta
    MS-Off Ver
    16.27
    Posts
    5

    Re: How to combine rows where one column has duplicate value but other columns are unique?

    Thanks so much! The first solution works fine (I just posed both cases as they were both acceptable). Do you mind explaining a bit what this function is doing?

  4. #4
    Registered User
    Join Date
    08-01-2019
    Location
    Calgary, Alberta
    MS-Off Ver
    16.27
    Posts
    5

    Re: How to combine rows where one column has duplicate value but other columns are unique?

    Sorry - is there a way for it to check for unique values? (If it is Bob vs. Sally, if there is a duplicate in one column but not the other)
    Attached Files Attached Files

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

    Re: How to combine rows where one column has duplicate value but other columns are unique?

    =IFERROR(INDEX($B:$B,AGGREGATE(15,6,ROW($A$4:$A$8)/($A$4:$A$8=$A11),COLUMNS($B:B))),"")

    Red: if this condition is TRUE
    Orange: return the row number
    Cyan: from the smallest to the largest
    Blue: in the order 1,2,3
    Green: and return the corresponding vlaues in column B
    Black: if an error is returned - return a blank.

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  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 2403
    Posts
    44,036

    Re: How to combine rows where one column has duplicate value but other columns are unique?

    Away for an hour or so. On a bus!!

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

    Re: How to combine rows where one column has duplicate value but other columns are unique?

    Just drag the formulae down. However, to get rid of the irritating 0s in B & E, amend the formula in column B to;

    =IFERROR(INDEX($B:$B,AGGREGATE(15,6,ROW($A$4:$A$9)/($A$4:$A$9=$A12),COLUMNS($B:B)))&"","")

    and similarly for column E.
    Attached Files Attached Files

+ 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. Combine/merge duplicate rows but retain unique data
    By Natalie Hanlon in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-02-2015, 01:22 PM
  2. Merge Duplicate Rows and Combine Unique Data
    By rickt33 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2015, 09:12 PM
  3. Please help me combine duplicate rows and average 2 columns
    By pluqk in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-19-2014, 04:02 PM
  4. Combine rows with a unique ID and then sum up like columns
    By kcampbell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2014, 09:37 AM
  5. Combine rows with duplicate values into separate columns
    By itgeekgroup in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-18-2014, 11:12 AM
  6. Merge Duplicate Rows unique values into single rows for an infinite amount of columns/rows
    By aimeecrystalaid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2013, 08:43 PM
  7. Duplicate rows, delete columns w/same data, combine columns w/unique data, Mac Excel 2011
    By msmcoin in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 02-03-2013, 02:10 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