+ Reply to Thread
Results 1 to 8 of 8

Find duplicates in one column, and combine all rows into one with new columns

  1. #1
    Registered User
    Join Date
    03-01-2021
    Location
    United States
    MS-Off Ver
    2101
    Posts
    6

    Find duplicates in one column, and combine all rows into one with new columns

    Hi, there!

    I'm trying to find duplicates from one particular column, and take the information attached to them and put them all in one row (combining the data of the multiple rows into one). For example, if I have an account number showing three times in column B, and I need all that data in all three rows and multiple columns but I want to view it in just one row with different column names to keep it all straight, how do I do that? And is there a way to find all the duplicates in column B for the whole worksheet, and do the same action to everything, rather than going to each duplicate one-by-one?

    Thank you in advance for any help you can offer! I've researched and struggled with this for days, and can't quite find the solution I'm looking for, and can't handle defeat!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,165

    Re: Find duplicates in one column, and combine all rows into one with new columns

    Hi BJXcel,

    A very similar question was asked a few days ago with two good answers. See it at:
    https://www.excelforum.com/excel-gen...t=#post5477786
    If the above doesn't help, keep asking and supply a sample workbook to improve your chances of getting a good/better ansewr.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    03-01-2021
    Location
    United States
    MS-Off Ver
    2101
    Posts
    6

    Re: Find duplicates in one column, and combine all rows into one with new columns

    Thank you so much, MarvinP! I looked at the “transpose-or-pivot-neither-transpose-or-pivot-but-unique-and.xlsx” file that was shared and it appears to do exactly what I need it to, but how exactly? Thanks again!

  4. #4
    Registered User
    Join Date
    03-01-2021
    Location
    United States
    MS-Off Ver
    2101
    Posts
    6

    Re: Find duplicates in one column, and combine all rows into one with new columns

    And can I do this in one sweep?

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,165

    Re: Find duplicates in one column, and combine all rows into one with new columns

    Hi,

    We need a sample of your data to see where things are. Which columns need sweeping and which need staying. Without a good sample we just can't give you a good answer. Read the yellow header on the site to learn how to attach a sample workbook.

  6. #6
    Registered User
    Join Date
    03-01-2021
    Location
    United States
    MS-Off Ver
    2101
    Posts
    6

    Re: Find duplicates in one column, and combine all rows into one with new columns

    Here is an example! Thanks.

  7. #7
    Registered User
    Join Date
    03-01-2021
    Location
    United States
    MS-Off Ver
    2101
    Posts
    6

    Re: Find duplicates in one column, and combine all rows into one with new columns

    So, to be clear, in my example I want the account number to be the unique item/column that the consolidation is being based on. And in the end, I want only one row associated with any one account number. If all the rows of information get thrown into one consolidated row, at least I can go back through and make column headers that make the new data clear if data repeats itself. The reason I'm wanting to do all of this, is because I want to do a mail merge, and that's not going to work having rows of repeat data.

    Additionally, with the mail merge, I may have to even put two different accounts for the same person on the same line. I'm hoping that if I can learn how this works, I can adjust as needed. Example: Jill Smith has two different accounts, and five rows of data. I either need her to have two rows total, or just one with all the info.

    Please let me know if I'm not making sense, and thanks for your willingness to help teach newbies like myself.
    Last edited by BJXcel; 03-02-2021 at 09:40 AM.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,522

    Re: Find duplicates in one column, and combine all rows into one with new columns

    Perhaps this will help:
    The range is converted to a table so that when new records are added the formulas in the result range will reference the new rows automatically.
    Another column is added and is populated using: =CONCATENATE(E2&", "&F2&", "&G2&", "&H2)
    In the result the first column (K) is populated using: =IFERROR(INDEX(A$2:A$14,MATCH(0,INDEX(COUNTIF(K$1:K1,A$2:A$14),,),)),"")
    The next three columns are populated using: =IF($K2="","",INDEX(B$2:B$14,MATCH($K2,$A$2:$A$14,0)))
    The added column is pivoted into rows using: =IF($K2="","",IFERROR(INDEX($I$2:$I$14,AGGREGATE(15,6,(ROW($I$2:$I$14)-ROW($E$1))/($A$2:$A$14=$K2),COLUMNS($A$1:A$1))),""))
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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: 1
    Last Post: 02-27-2019, 11:19 PM
  2. [SOLVED] Combine Rows For Duplicates in Column
    By billgyrotech in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-20-2016, 10:11 AM
  3. Replies: 7
    Last Post: 03-13-2015, 05:34 PM
  4. Replies: 2
    Last Post: 01-13-2014, 10:52 AM
  5. Replies: 1
    Last Post: 02-13-2012, 08:08 PM
  6. Need to combine like rows by duplicates in 2 columns
    By toolmanwill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2011, 12:58 AM
  7. Replies: 4
    Last Post: 12-04-2007, 03:08 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