Skip to main content

How to find and highlight duplicate rows in a range in Excel?

Author: Xiaoyang Last Modified: 2024-11-28

Sometimes, duplicate records may exist in your worksheet's data range, and you may need to find or highlight these duplicate rows, as shown in the following screenshots. Manually checking each row for duplicates is time-consuming and impractical, especially when dealing with hundreds of rows. This guide will introduce several efficient methods to handle this task effectively.

A screenshot showing duplicate rows with first occurrences highlighted   A screenshot showing duplicate rows without first occurrences highlighted

Find duplicate rows across multiple columns with formulas

Highlight duplicate rows across multiple columns with Conditional Formatting

Select or highlight duplicate rows across multiple columns with a handy feature


Find duplicate rows across multiple columns with formulas

The following formula can help you find the duplicate records, please do as this:

1. In the adjacent blank cell, cell D2 in this case, please enter the below formula:

=IF(COUNTIFS($A$2:$A$12,$A2,$B$2:$B$12,$B2,$C$2:$C$12,$C2)>1, "Duplicate row", "")

2. And then drag the fill handle down to the cells for applying this formula, now, you can see, if there are identical rows in this used range, it will display Duplicate row, see screenshot:

A screenshot showing results of using a formula to find duplicate rows in Excel

  • Notes:
  • 1. In the formula, $A$2:$A$12, $B$2:$B$12, $C$2:$C$12 indicate the range columns that you want to find the duplicate from. You can change them as you want. And A2, B2, C2 indicate the first cells in the each column of the data which needed to be applied this formula, you can change them as well.
  • 2. The above formula is based on data in 3 columns, if there are 4 or more columns in your data range which needed to be found the duplicated values from the first row, you just need to add the column references as shown in this formula: =IF(COUNTIFS($A$2:$A$12,$A2,$B$2:$B$12,$B2,$C$2:$C$12,$C2,$D$2:$D$12,$D2)>1, "Duplicate row", "").

Tips: If you want to find duplicate rows without the first occurrences, please apply the following formula:

=IF(COUNTIFS($A$2:$A2,$A2,$B$2:$B2,$B2,$C$2:$C2,$C2) >1, "Duplicate row", "")

A screenshot displaying how to exclude first occurrences while finding duplicate rows in Excel


Highlight duplicate rows across multiple columns with Conditional Formatting

If you can’t apply the formula correctly, please don’t worry, the Conditional Formatting utility also can help you highlight the duplicate rows. Do with the following steps:

1. The first step you should to use the CONCATENATE function to combine all the data into one cell for each row. Type the below formula in cell D2, then copy the formula down until the last row of data see screenshot:

=CONCATENATE(A2,B2,C2)

A screenshot showing CONCATENATE formula used to combine data from multiple columns in Excel

2. Then, select the range that you want to find the duplicate rows including the formulas in column D, and then go to Home tab, and click Conditional Formatting > New Rule, see screenshot:

A screenshot showing the Conditional Formatting option

3. In the New Formatting Rule dialog box, please do the following operations:

  • Click Use a formula to determine which cells to format from the Select a Rule Type list box;
  • And then, enter this formula =COUNTIF($D$2:$D$12,$D2)>1 (Highlight duplicate rows with first occurrences) or =COUNTIF($D$2:$D2,$D2)>1 (Highlight duplicate rows without first occurrences) into the Format values where this formula is true text box;
  • At last, click Format button.

A screenshot showing the Conditional Formatting rule creation for duplicate rows in Excel

Note: In the above formula, $D$2:$D$12 is the column D that you have combined the other column values.

4. In the popped out Format Cells dialog box, click Fill tab, and then, choose one color that you need to highlight the duplicates.

A screenshot showing the Format Cells dialog for choosing highlight color for duplicates

5. Click OK > OK to close the dialog boxes, and the duplicate rows are highlighted by the color you choose at once, see screenshot:

Highlight duplicate rows with the first ones Highlight duplicate row without the first ones
A screenshot showing duplicate rows with first occurrences highlighted A screenshot showing duplicate rows without first occurrences highlighted

Select or highlight duplicate rows across multiple columns with a handy feature

The above methods are somewhat troublesome for you, so here, I can introduce you an easy and handy tool-Kutools for Excel, with its Select duplicate & unique cells utility, you can quickly select the duplicate rows or unique rows as you need.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. Click Kutools > Select > Select Duplicate & Unique Cells, see screenshot:

A screenshot showing the Kutools Select Duplicate & Unique Cells option in Excel

2. In the Select duplicate & unique cells dialog box, please do the following operations:

  • Click Range selection button button to select the range that you want to use;
  • Then, select Each row from the Based on section;
  • And then,check Duplicates(Except 1st one) or All duplicates(Including 1st one) option under Rule section as you need;
  • At last, you can specify a background color or font color for the duplicate rows under the Processing of results.

A screenshot showing the Select Duplicate & Unique Cells dialog

3. Then click OK, and the duplicate rows are selected as following screenshots:

Select duplicate rows including the first ones Select duplicate rows excluding the first ones
A screenshot showing duplicate rows with first occurrences highlighted A screenshot showing duplicate rows without first occurrences highlighted
  • Notes:
  • 1. If you check Select entire rows option, the entire duplicate or unique rows will be selected.
  • 2. If you check Case sensitive option, the text will be compared case sensitive.

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now


More relative articles:

  • Combine Duplicate Rows And Sum The Values In Excel
  • In Excel,you may always meet this problem, when you have a range of data which contains some duplicate entries, and now you want to combine the duplicate data and sum the corresponding values in another column, as following screenshots shown. How could you solve this problem?
  • Highlight Duplicate Values In Different Colors In Excel
  • In Excel, we can easily highlight the duplicate values in a column with one color by using the Conditional Formatting, but, sometimes, we need to highlight the duplicate values in different colors to recognize the duplicates quickly and easily as following screenshot shown. How could you solve this task in Excel?
  • Align Duplicates Or Matching Values In Two Columns
  • If you have two list of names, and you want to compare these two columns and find the duplicates in both, and then align or display the matching names based on the first column in a new column as following screenshot shown. To list the duplicate values which exist in both columns, this article may introduce some tricks for solving it.

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!