+ Reply to Thread
Results 1 to 12 of 12

List duplicates in separate column

  1. #1
    Registered User
    Join Date
    08-09-2012
    Location
    Swindon, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    List duplicates in separate column

    Running Excel 2003.
    I have a list in column B, of numerical codes. What I want to do is find the duplicates, and list the duplicates in column D.
    Is this possible?

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

    Re: List duplicates in separate column

    Hi gillmacca,

    There are a few ways to do this problem. It is easier if you supply a sample workbook so we can see the data. See the attached for what I think you want?

    There are 3 methods shown.
    1. Advanced Filters with a Unique box checked
    2. Pivot Tables with a filter of 2 filtered
    3. Conditional Formatting - not sure you can see this with 2003 Excel

    1 and 2 above use the Helper Column Formula.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    08-09-2012
    Location
    Swindon, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: List duplicates in separate column

    Unfortunately I am at work and do not have Internet access on the work PC (sending thus via phone), so I will try to explain better.
    Example:
    Column B contains: 1,2,3,4,5,2,6,7,4,6
    I would like to be able to display the duplicates (2,4 & 6) in column D

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

    Re: List duplicates in separate column

    Hi,

    My example shows different ways to solve your problem. I've used Column A instead of Column B for my numbers. When you get to your computer open the workbook and find some different methods. They all center around what I did in Col B and a CountIf function.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,039

    Re: List duplicates in separate column

    If your data is in B2:B11, in C2, copied down, use this...
    =IF(COUNTIF($B$2:B2,B2)>1,MAX($C$1:C1)+1,MAX($C$1:C1))

    Then in D2, copied down, use this...
    =IFERROR(INDEX($B$2:$B$11,MATCH(ROW(A1),$C$2:$C$11,0),1),"")

    Marvin's solution will work perfectly for you though
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Re: List duplicates in separate column

    Hi @FDibbins,

    What am I missing with your answer?? See the attached where I tried your formula on my random data.
    Attached Files Attached Files

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,039

    Re: List duplicates in separate column

    Thanks for picking that up Marvin, the formula in C should be...
    =IF(COUNTIF($B$2:B2,B2)=2,MAX($C$1:C1)+1,MAX($C$1:C1))

  8. #8
    Registered User
    Join Date
    08-09-2012
    Location
    Swindon, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: List duplicates in separate column

    In column C, I am either getting a 0,1 or 2.
    In column D, I am getting #NAME?

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,039

    Re: List duplicates in separate column

    If you upload Marvin's file from post #6 and change the formula in C2 to...
    =IF(COUNTIF($B$2:B2,B2)=2,MAX($C$1:C1)+1,MAX($C$1:C1))
    copied down, and then in D2, copied down, use this...
    =IFERROR(INDEX($B$2:$B$45,MATCH(ROW(A1),$C$2:$C$45,0),1),"")

  10. #10
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: List duplicates in separate column

    for excel 2003 what about the Array Formula

    =IF(ISERROR(INDEX(B1:B11, MATCH(0, COUNTIF(C$1:$C1, B1:B11)+IF(COUNTIF(B1:B11, B1:B11)>1, 0, 1), 0))), "", INDEX(B1:B11, MATCH(0, COUNTIF(C$1:$C1, B1:B11)+IF(COUNTIF(B1:B11, B1:B11)>1, 0, 1), 0)))
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,039

    Re: List duplicates in separate column

    aahhh I missed the "running 2003" bit, I just looked at the profile - no wonder you get an error trying to use iferror, sorry (please update your profile to what version you are using)

    =IF(ISERROR(INDEX($B$2:$B$45,MATCH(ROW(A1),$C$2:$C$45,0),1)),"",INDEX($B$2:$B$45,MATCH(ROW(A1),$C$2:$C$45,0),1),""))

  12. #12
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: List duplicates in separate column

    two many arguments
    FDibbins
    should that be ...
    =IF(ISERROR(INDEX($B$2:$B$45,MATCH(ROW(A1),$C$2:$C$45,0),1)),"",INDEX($B$2:$B$45,MATCH(ROW(A1),$C$2:$C$45,0),1))

    But still prefer the formula with out helper column
    C2=IF(ISERROR(INDEX(B1:B50, MATCH(0, COUNTIF(C$1:$C1, B1:B50)+IF(COUNTIF(B1:B11, B1:B50)>1, 0, 1), 0))), "", INDEX(B1:B50, MATCH(0, COUNTIF(C$1:$C1, B1:B50)+IF(COUNTIF(B1:B50, B1:B50)>1, 0, 1), 0))) .... Ctrl+shift+enter fill down

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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