+ Reply to Thread
Results 1 to 6 of 6

Remove duplicate rows and move the column data to a new column

  1. #1
    Registered User
    Join Date
    12-22-2015
    Location
    NY
    MS-Off Ver
    Office 365
    Posts
    13

    Question Remove duplicate rows and move the column data to a new column

    Hello, I haven't been able to find a great way to do this so I wanted to ask around.

    What I have:

    ID Data1
    1 A
    1 B
    2 C

    What I need:

    ID Data1 Data2
    1 A B
    2 C

    Does anyone know of an automated way to do this? Please note, some rows have duplicates and some do not (leads me to think a macro wouldn't be the best way to do this)

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: Remove duplicate rows and move the column data to a new column

    So what happens when there are duplicates? It would help if you post a small sample Excel file.

  3. #3
    Registered User
    Join Date
    12-22-2015
    Location
    NY
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Remove duplicate rows and move the column data to a new column

    Basically just the above example. If there are two rows for ID# 1, I want to turn it into one row and expand out the columns. I.e., row 2's column B becomes row 1's column C.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: Remove duplicate rows and move the column data to a new column

    Try

    =IFERROR(INDEX($B$2:$B$50,SMALL(IF($A$2:$A$50=$E2,ROW($A$2:$A$50)-ROW($A$2)+1,""),COLUMNS($A:A))),"")

    Enter with Ctrl+Shift+Enter

    Copy across and down as far as required

    E2=1,
    E3=2

    etc

  5. #5
    Registered User
    Join Date
    12-22-2015
    Location
    NY
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Remove duplicate rows and move the column data to a new column

    Quote Originally Posted by JohnTopley View Post
    Try

    =IFERROR(INDEX($B$2:$B$50,SMALL(IF($A$2:$A$50=$E2,ROW($A$2:$A$50)-ROW($A$2)+1,""),COLUMNS($A:A))),"")

    Enter with Ctrl+Shift+Enter

    Copy across and down as far as required

    E2=1,
    E3=2

    etc
    Seems to be turning all 1's regardless.. hmmm
    Capture.JPG

    =IFERROR(INDEX($B$2:$B$50,SMALL(IF($A$2:$A$50=$A$2,ROW($A$2:$A$50)-ROW($A$2)+1,""),COLUMNS($A:A))),"")

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: Remove duplicate rows and move the column data to a new column

    See attached
    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. [SOLVED] How to remove duplicate data but leave the row with highest value from another column
    By mgilmore77 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-22-2014, 08:59 PM
  2. [SOLVED] Move A column text to previous row if duplicate in B column
    By greek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2014, 12:06 AM
  3. [SOLVED] Remove duplicate entries from one column and output it into another column using formulas
    By alrikvincent in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-12-2014, 08:55 AM
  4. [SOLVED] Move rows with duplicate values in column J to next worksheet
    By theletterh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2013, 10:38 AM
  5. Remove rows with duplicate values in one column based on value of another column
    By jolleyje in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-15-2013, 06:20 AM
  6. Remove Duplicate (Prioritized on data in a different column)
    By rmikulas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2010, 08:17 AM
  7. Replies: 1
    Last Post: 05-31-2005, 08:05 PM

Tags for this Thread

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