Excel: How to Remove Duplicate Rows Based on Two Columns


Often you may want to remove duplicate rows based on two columns in Excel.

Fortunately this is easy to do using the Remove Duplicates function within the Data tab.

The following example shows how to use this function in practice.

Example: Remove Duplicates Based on Two Columns in Excel

Suppose we have the following dataset that shows the team name and position of various basketball players:

Notice that there are several duplicates across both columns.

For example:

  • There are multiple players who have a team of A and a position of Guard.
  • There are multiple players who have a team of A and a position of Forward.

And so on.

To remove these rows that have duplicates across two columns, we need to highlight the cell range A1:B16 and then click the Data tab along the top ribbon and then click Remove Duplicates:

In the new window that appears, make sure the box is checked next to My data has headers and make sure the boxes next to Team and Position are both checked:

Once you click OK, the rows with duplicate values across both columns will automatically be removed:

Excel tells us that 6 duplicate rows were found and removed and that 9 unique rows remain.

Notice that none of the remaining rows have duplicate values across both columns.

For example:

  • There is only one row where Team is equal to A and Position is equal to Guard.
  • There is only one row where Team is equal to A and Position is equal to Forward.

And so on.

Additional Resources

The following tutorials explain how to perform other common operations in Excel:

Excel: How to Delete Rows with Specific Text
Excel: How to Ignore Blank Cells When Using Formulas
Excel Advanced Filter: Display Rows with Non-Blank Values

Leave a Reply

Your email address will not be published.