Comments on: How to find duplicates in Excel: identify, highlight, count, filter

The tutorial explains how to search for duplicates in Excel. You will learn a few formulas to identify duplicate values or find duplicate rows with or without first occurrences. You will also learn how to count instances of each duplicate record individually and find the total number of dupes in a column, how to filter duplicates, and more. Continue reading

Comments page 3. Total comments: 262

  1. Hello,

    Can you help me with my problem?
    How to remove duplicates in different column?

    original data It's like this:

    1 1 5 5 5 3 4 4

    and turn to this:

    1 5 3 4

    Remove the duplicates but retain the 1st one.

    Thank you in advance.

    1. Hello!
      All duplicate detection methods require data to be arranged vertically in columns. Therefore, first, transpose the data as described in this guide. Then remove the duplicates. For detailed instructions, see this article. Then transpose the data again.

  2. Thank you so much this was such a huge help!

  3. Hello Alex!
    i just want to know how do I command a duplicate cell to join to different cells into one

    Example;
    Column A Column B Column C (where a+b)
    Apple Fruit Apple Fruit + Red
    Apple Red
    Banana Yellow Banana Yellow

  4. How do i separate the duplicate numbers/codes from each other in one excel sheet? sample below?

    1)
    1759DD447361
    1759DD447361
    1759DD447369
    1759DD447369
    1759DD447381
    1759DD447381

    2)
    1759DD447361
    1759DD447369
    1759DD447381

    1759DD447361
    1759DD447369
    1759DD447381

    1. Hi!
      What does "separate the duplicate" mean? Have you tried the ways described in this blog post? If they don’t work for you, then please describe your task in detail, I’ll try to suggest a solution.

      1. Thank you Alex!
        In my previous comment, there are two items. Item 1) has all the records, while item 2) the duplicates have been separated on same excel sheet. How can i achieve that and still keep both records in same sheet?

          1. Thanks

  5. This is great! However, I'm thinking of multiplying a certain no. or cell using if function for duplicates. Say if k3 cell duplicates within k1:k6, e3*85%, otherwise e3=100%.

    Tried using this --> [=another formula*(if(countif(k1:k6,k3)>1,e3*0.85,e3*1)] but sadly errors.

    Would anyone know how to go about this? Thanks in advance!

    1. Hello!
      This formula works for me.

      =(A3+A4)*IF(COUNTIF(K1:K6,K3)>1,E3*0.85,E3*1)

      If you get an error, please describe the problem in more detail.

      1. You're Godsent. Got why it errors. I doubled the multiplication in the formula. Thanks so much! :)

  6. how can we identify the duplicate location/reference designators in the different rows?

    Example
    1:-
    R1 Duplicate in both.

    R1.

    R1,R11,R12,R35,R187,R196,R203,R220,R221,R230,R231,R232,R233,R245,R246,R272,R283,R292,R297,R303,R321,R322,R342,R343,R345,R346,R349,R386,R406,R409,R532,R544,R555,R811,R812,R1033,R1034,R1035,R1036,R1779..

    2:-
    R4 Duplicate in Both.

    R4,R6.

    R2,R3,R4,R5.

    3:-
    R5 Duplicate in Both.

    R2,R3,R4,R5.

    R5,R46,R47,R48,R49,R54,R58,R60,R61,R65,R75,R82,R83,R84,R85,R86,R87,R184,R189,R190,R191,R192,R193,R238,R239,R240,R241,R258,R265,R266,R267,R268,R275,R276,R277,R278,R286,R287,R288,R289,R293,R294,R295,R296,R298,R299,R301,R331,R332,R333,R334,R335,R336,R337,R338,R339,R341,R344,R351,R352,R353,R354,R355,R356,R357,R358,R705,R867,R921,R924,R977,R978,R980,R981,R1038,R1052,R1053,R1767,R1768,R1769,R1772,R1784,R1785,R1786.

    1. Hello!
      Split each cell. Use a comma as a separator. To do this, you can use the Split Text tool. Use Duplicate Remover - Find Duplicate Cells tool to find duplicates. It is available as a part of our Ultimate Suite for Excel that you can install in a trial mode and check how it works for free.
      If something is still unclear, please feel free to ask.

  7. Using a formula(s), is there a way to find duplicate rows with multiple columns but info in columns are not necessarily in the same order.where the examples below are considered duplicates even if they're not in order?
    A B C D
    LAX SFO ATL DUPLICATE
    PDX ATL LAX
    LAS ATL LAX
    JAX LAX PDX
    SFO ATL LAX DUPLICATE
    JAX LAS MCI

  8. Hello,
    First, great tutorial, very useful. I applied some of the formulas to solve a situation. I just needed to know if the data I load into an Excel table is duplicated, I don't need to know which rows are repeated, just to know the data is wrong so I can go to source to solve a problem I didn't know existed. The approach of the array formula that does not require a helper column seems the best option:
    =ROWS($A$2:$A$8)-SUM(IF( COUNTIFS($A$2:$A$8,$A$2:$A$8, $B$2:$B$8,$B$2:$B$8)=1,1,0))
    But then I came across a situation. Sometimes one of the columns can have a blank value, when that happens the formula identifies that row as not unique and returns a wrong value. I could fix the situation with this formula:
    =ROWS($A$2:$A$8)- SUM(--( COUNTIFS($A$2:$A$8,$A$2:$A$8, $B$2:$B$8,choose({1,2},$B$2:$B$8,""))=1))
    As you can see, I added the "choose" function with {1,2} as the index num so the "Choose" function returns both, the complete range that is used as criteria plus the empty space value "" counting correctly the blank cells when needed.
    Another change I did was the use of "--" instead of the "if" function, but that doesn't change the result.

    1. Hi,

      I have 1500 lines data, I have to identify the duplicate with B collom and C collom,if that should match cell details and C cell details,how can I apply the formula for identifying the duplicate with same details matching with more than one.

      1. Hi! It's hard to tell exactly what you're asking for as it's currently written. Pay attention to the following paragraph of the article above: How to find duplicate rows in Excel. Or explain your problem in more detail.

  9. Dear Sir/Madam,

    Is there a way to find duplicate values in a single cell in MS-Excel? I'm working on a CSV file where there are duplicate values occurring in a single cell only. Can you please help?

  10. How to find last 4 digit duplicate value and marked. is there any formula. e.g.
    JVC2020TDL2946
    BV2020TDL2946
    JVC2020TDL2947
    BV2020TDL2947
    JV2020TDL0224
    JV2020TDL0225

    1. Hello!
      You can extract the last 4 digits into a separate column using the RIGHT function. Then look for duplicates in that column as described in the tutorial above.
      I hope this will help, otherwise please do not hesitate to contact me anytime.

      1. Thanks Sir
        for your reply and i have also tried this option it will work properly.

  11. I know that this is old but the easiest solution would be to highlight a column, go to conditional formatting->highlight cell rules, then duplicates. After that, just filter by color.
    To rmove them, there is a built in button in excel, under the data tab.

  12. How to choose repeated number example for this case:
    12344445678910444. The correct answer is 4

  13. Hi, I need to modify the formula that extracts ONLY duplicates from column to make it able to work from the first row.
    =IFERROR(INDEX(A$2:A$16,MATCH(1,COUNTIF($A$1:A1,A$2:A$16)=0)*COUNTIF(A$2:A$16,A$2:A$16)>=2)),0)),"")
    As you can see it doesn't allow to be placed in the first row due to cell reference problem in this part COUNTIF($A$1:A1,A$2:A$16).

    Is there any alternative option?

  14. Hi
    I hope you are doing very well.

    Your solutions are very helpful.

    Thanks a lot.

  15. hi, how to find duplicate from 2 sheets and highlight with color

    1. Hello!
      All the recommendations you need are listed in the article above. Make external references to another sheets of your workbook correctly as described in this guide.

  16. I am trying to count how many duplicate names are found in Col A. I have 600 plus rows and I just want the count each time I find a duplicate value. I tried

    Column B
    =COUNTIF($A$2:$A$800, $A2)

    Column C
    =IF(COUNTIF($A$2:$A$800, $A2)>1, "Duplicate", "Unique")

    But I only return 722 value in Column, and only Duplicate in Column C (used to remove Duplicate, just leave one count total.)

    Im looking for:
    Appels 121
    Grapes 253
    Bananas 10
    Oranges 400

    Is this possible? Any kind help?

    1. Hi,
      I don't really understand what you want to find. To remove duplicates, it is best to use a formula that ignores the first occurrence of the value. See "How to search for duplicates in Excel without 1st occurrences". To remove duplicates, I recommend using Duplicate Remover Toolkit for Excel. It is available as a part of our Ultimate Suite for Excel that you can install in a trial mode and check how it works for free.
      If this is not what you want, please describe the problem in more detail. I will try to help.

  17. Hi,

    I would need some help regarding this issues:
    1. I have a list with names, I had found the duplicates. My task is: Using a single formula, detect all of the duplicates in the above list. If the term has already appeared in the list, then your formula should display it on the same row, if the term has not already appeared on the list then your formula should display N/A.

    Name
    Cristina
    Ioana
    Florin
    George
    Cristina
    Cosmin
    Neculai
    Alina
    Florentina
    Andreea
    Laura
    Alina

    2. I need a formula for completing this task: Create a formula that returns only the characters that appear after "X" for the given character strings. The same formula must work for the whole column!
    Example: 45629X421 421

    1. Hello!
      I hope you have studied the recommendations in the tutorial above. It contains answers to your question.
      To return all characters after "X" use the formula

      =MID(B1,SEARCH("X",B1,1)+1,100)

      I hope it’ll be helpful.

    2. I found the formula for task 2.
      Any thoughts for the 1st task?

      Thanks!

  18. How do i get collegue names if website duplicates. Let say first 3 people are at same company (same website) So i need to get collegue name such as

    Sam - Nick
    Nick - David
    David - Sam

    How do i get them.

    Full Name Collegue Name Website
    Sam abc.com
    Nick abc.com
    David abc.com
    Peter 123.com
    Ann 123.com

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      {=IFERROR(INDEX($B$2:$B$12, SMALL(IF($D2=$A$2:$A$12, ROW($B$2:$B$12)-1,""), COLUMN()-4)),"")}

      This is an array formula and it needs to be entered via Ctrl + Shift + Enter, not just Enter. Line 1 is the title of the table. Column A is a list of websites. Column B is a list of names. Column D is the website where you want to find the names of colleagues.
      You can read more about this formula in the article: How to VLOOKUP multiple values in Excel
      You can combine names in one cell with delimiters using the formula

      =TEXTJOIN("-",TRUE,J2:N2)

      I hope my advice will help you solve your task. If something is still unclear, please feel free to ask.

  19. Hello,
    sorry, how to find the last duplicate value in row ,
    such as:
    A B C D
    2 4 3 2

    i want to find the number "2" that is from column "D"
    tnx..

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      =IFERROR(INDEX((IF(COUNTIF(A1:F1,A1:F1)>1,A1:F1,"")),,MATCH(TRUE,(IF(COUNTIF(A1:F1,A1:F1)>1,A1:F1,""))<>"",0)),"")

      I hope I answered your question. If something is still unclear, please feel free to ask.

  20. extremely killer tricks.... Brilliant.... Many wishes for you and best of luck...

  21. how can I set formula to move any duplicates document id to next 3 columns in excel? thanks

    document id: 1st allocation id 2nd allocation id 3rd allocation ID
    12345
    23456
    12356
    11236
    23456
    23562
    89712
    12345
    12346
    12356

    1. Hello!
      Sorry, it's not quite clear what you are trying to achieve. I don't see any pattern in your numbers. Could you please describe it in more detail? What result do you want to get?

  22. I am creating a quiz bank. I want to find duplicates within a row and then be able to copy the formula down a column. I tried using the formula =IF(COUNTIF(C1:I1,), "duplicate", ""). However it only returns duplicates of the first cell. I need to know if ANY of the cells in that row are duplicates. Please help!

    1. Hello!
      If I got you right, the formula below will help you with your task:

      =IF(SUM(--(COUNTIF(C1:I1,C1:I1)>1)) > 0,"duplicate","")

      After that, you can copy this formula down along the column.
      I hope it’ll be helpful.

      1. It works perfectly! Thank you SOOOOOOOO much!

    2. Sorry I just realized the formula i put in above is not the formula I am using. It is =if(countif(C1:I1,C1)>1 "duplicate", "")

  23. If the range is not continious, example A1:A5 and B1:B15 then how to check if the 15 values in these cells have duplicate or not

  24. Hey
    How to paste data in a merge cell
    Help me if u know

    1. Hello!
      I’m sorry but your task is not entirely clear to me.
      Please describe your problem in more detail. Write an example of the source data and the result you want to get. It’ll help me understand it better and find a solution for you. Thank you.

  25. Quick Question, Is there a way to set the 1st row of duplicate records to "Parent"
    I am using this formula: =IF(COUNTIFS($A$2:$A,A2,$B$2:$B,B2,$C$2:$C,C2)>1,"Child","Parent")
    Row 1 - Parent
    Row 2 - Child
    Row 3 - Child
    instead of
    Row 1 - Child
    Row 2 - Child
    Row 3 - Child
    Help is greatly appreciated.

    1. Hello!
      If I understand your task correctly, you need to set the first occurrence of a duplicate as Parent" marking the rest of them as "Child".
      Assuming that your table has no header, here is the right formula for you:

      =IF(COUNTIF(A1:$A$26,A1)>1, IF(AND(COUNTIF(A1:$A$26,A1)>1, MATCH(A1,$A$1:$A$26,0)=ROW(A1)), "Parent","Child"),"")

      If however, there is a 1-line header, the formula should be modified a little to look like the one below:

      =IF(COUNTIF(A2:$A$27,A2)>1, IF(AND(COUNTIF(A2:$A$27,A2)>1, MATCH(A2,$A$2:$A$27,0)=ROW(A2)-1), "Parent","Child"),"")

      Hope this is exactly what you need.

  26. ok I have an excel worksheet that I want to add a formula to catch duplicates throughout the worksheet. I don't want the 1st selected column ex:A2 to change I want it to carry down to where it catches any above it, Say I am on row A 15 I want it to look at rows A2-A14 to make sure the information I added in A15 wasn't on any above it. Can you help with this please?

  27. Good Afternoon!
    I have a workbook spreadsheet (SP1) that is pulling data from another workbook spreadsheet (SP2) using an if statement formula. In SP2, column A, I'm pulling data from SP1, column G. I would like to highlight the row in SP2 if a duplicate is found in column A. However, I'm not sure if I can do that with there already being a formula in each cell.
    To better clarify my question - Is there a way to highlight a row when the data pulled in column A duplicates, and to not highlight if no data is pulled or the result is "false".

    My issue right now is that because there is a formula in every cell when I use conditional formatting it ends up highlighting the entire workbook. I only want it to highlight if column A shows a duplicate result (A1 formula result shows: a, A5 formula result shows: a).

  28. Thanks, Svetlana
    It was awesome.

  29. Is there a way to find the exact location (using Index and Match) next to the first, second (and so on) duplicate value? Suppose Mary 100 and Donald 100 in a long list of names in column A and values in column B. Would it be possible using Index/Match to put "Mary" and "Donald" in the same order in Column C?

  30. Hi,
    I need to flag 1st duplicate and 2nd duplicate till nth duplicate with respect to date.
    for ex: 01/01/2010 is having data with duplicates and using COUNTIF it can return 1st duplicate and then 02/01/2020 is having same data and I need to flag second duplicate vice versa.

    I am using below formula
    "{=IF(COUNTIF($A$3:A3,A3)>1,"NX","X")}
    here "X" return with 1st duplicate value

  31. I need to find out the duplicates for the below...anybosy pl help me..
    For example..
    Apple
    Banana
    Apple
    Banana
    Apple
    Banana
    Apple
    Apple
    In the last 2 rows, word apple repeated...this need to be find out in the consecutive list....1 :1 ratio only allowed...pl help

  32. for same exact work or number finding duplicate is ok
    but i am looking for something like this
    apple,banana
    apple,mango
    mango,banana
    how to find same word in a cell for whole column

  33. Hi,
    How can i get duplicate value or text & unique value or text by using reference in excel.

  34. Thank you very much, I have gained a lot and I can identify easily the duplicates for following the formulas.

    Abdinasir

  35. Wondering if there is a formula to begin counting up every there is a change in the name column; as so:
    Name #
    1 1
    1 2
    1 3
    2 1
    2 2
    2 3
    3 1
    3 2
    3 3
    4 1
    5 1
    6 1
    6 2
    7 1
    7 2
    7 3
    8 1
    8 2
    8 3
    9 1
    9 2
    10 1
    11 1
    11 2
    11 3

  36. Please how do I check for duplicate interval. eg
    hole_id depth_from depth_to
    NGC12-018 0 1.5
    NGC12-018 1.5 2.3
    NGC12-018 2.3 3
    NGC12-018 3 8.2
    NGC12-018 8.2 10.7
    NGC12-018 10.7 17.3
    NGC12-018 17.3 20.6
    NGC12-018 20.6 23.5
    NGC12-018 20.6 23.5
    NGC12-018 23.5 27.9
    NGC12-018 27.9 31.7
    NGC12-018 31.7 36.7
    NGC12-018 36.7 43.4
    NGC12-018 36.7 43.4
    NGC12-018 43.4 48.2
    NGC12-018 48.2 49.5
    NGC12-018 49.5 64.5
    NGC12-018 64.5 67.5
    NGC12-018 67.5 72.6
    NGC12-018 72.6 81
    NGC12-018 81 86.55
    NGC12-018 86.55 90

  37. I am working on a list of not duplicate text cells but some are close.
    I want to know how to only find the cells that are incorrect.
    How do I do that?
    Here is an example.
    9086264 SENSOR RTD JACKET HEATING TETRA PAK ALLM O-RING 9531-4040-591 FALSE
    9086266 SEAL CYLINDER CLOSING TOOL SCRAPER ROD 9531-6131-516 FALSE
    9086267 ARM CASE SIDE CLOSING GASKET 9531-6130-516 FALSE
    9086270 TRAP STEAM DISC TD42H SPIRAX SARCO O-RING 9531-4021-591 FALSE
    I have a list of 20,000 items that I can not go through indivually. I just want to make sure the first few characters match.

  38. Kindly Solve My Query in below there is two value in a saprate cells , i wants comman value in output cell.

    Value 1 Value 2 Output (Comman No.)
    21452 23652 25

  39. Hi, I'm using the duplicate formula but trying to add an index part so that it shows up the duplicate reference. Where am I going wrong and how do I correct it? I have: =INDEX(E:E(IF(COUNTIF(F:F,[@WON])>1,"Duplicate","")),0)
    I want to show the contents of the duplicate cell from column E, if it has the same contents as another cell in column F. So if row 3 has the same column F value as row 5, I want B3 to show the cell value from E5.
    I hope this makes sense.
    Thanks

  40. 016230240
    016259070
    012350891

    If i would like to add a 6 in front of above number only, example 016 become 6016230240 , the back of 0 will appear 6 also if i find 0 and replace by 6, however i just like to have 6 infront of the number, what is the the process , pls help, thank you..

  41. Hi,

    How can I distinguish repeating brand names? For example:
    Gillette --> Gillette 1
    Gillette --> Gillette 2
    Pantene --> Pantene 1
    Gillette --> Gillette 3
    Head & Shoulders --> Head & Shoulders 1
    Pantene --> Pantene 2

  42. How can i arrange the Values of duplicate attendance number from below
    Attendace Value
    168755 41759002
    168755 41704067
    197119 40316326
    197119 40811539
    204786 41446987
    204786 41025753
    285943 41696614
    285943 41232806
    181907 40538480
    181907 40117598
    986727 40450723
    986727 41072614
    768565 40098263
    768565 40403845
    693968 40455014
    693968 40987284
    998263 40044440
    998263 40928398
    366864 41736203
    366864 41644887
    837218 40222382
    837218 40621245
    837218 4063258
    to
    Attendance Value 1 Value 2 Value3
    168755 41759002 41704067
    197119 40316326 40811539
    204786 41446987 41025753
    285943 41696614 41232806
    181907 40538480 40117598
    986727 40450723 41072614
    768565 40098263 40403845
    693968 40455014 40987284
    998263 40044440 40928398
    366864 41736203 41644887
    837218 40222382 40621245 4063258

  43. Hi
    am saikat patra from Howrah in west bengal.
    Can anyone help me about if count formula details given below.
    colum 1 colum 2
    78120 above10days
    78121 above10days
    78122 abovel0days
    78560 above5days
    78121 above10days
    How to count colum 2 tex wise to colum 1 shipment no without duplicate.
    ans should be if above10days basis is "3".
    please help me and very much gladfull to you for this.

  44. Hi,

    how can i get the duplication data for example i want the excel to read the data from 6 last alphabet of an email.

  45. Highlight duplicate values across multiple worksheets.
    I have a workbook with four worksheets. We are clearing out a storage center and listing the bins on worksheet "Empty Bins" as they become empty. Worksheets "Aisle 1", "Aisle 2", and "Aisle 3" list all the bins in the system.
    How do compare the data on worksheet "Empty Bins" to the data on the three other worksheets to find and highlight duplicates? Thank you.

  46. I have 55000 entries in a single column 10 digit numbers. I have to find duplicates. But the problem is the numbers may have difference by addition of excess 3 4 digits at the ending or starting.

  47. If duplicate is there, then I want result as first value in row1 against duplicate name. Any one pls. help to get result as mentioned in column3
    Eg, below.
    Column1---Column2---Column3(RESULT)
    1 -------Siva -------1
    2------- Kumar -------2
    3 -------Suresh ------3
    4 -------Siva ------1
    5 --------Kumar -----2

  48. I have a row with header in row1, for example; Boat1, Boat2, Boat3, Boat4, Boat5 and numbers in the next row, 5, 6, 7, 5, 4. I want to identify the duplicate headers or header/number, which in this case is Boat1, Boat4 or Boat1/5, Boat4/5. Happy for the result to be shown in two separate cells.

    Thank you

  49. good evening sir

    i have a problem that
    i type some values ie., 2,4,5,7,8,2,9 in a specific cell how to find out duplicate values in excel cell please send forumala for self use it is very need full to me

  50. dear all,
    is that able to find the decimal value from next column:

    1101
    1102
    1103
    1101H
    1102HR
    1103H

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)