how to remove duplicate values in one column in excel

How to Remove Duplicate Values in One Column in Excel

By Brian Williams
AD

Duplicate values can clutter your Excel data, making it difficult to analyze and interpret. If you're working with a column that's riddled with duplicates, you'll want to clean it up. Here's a step-by-step guide on how to remove duplicate values in one column in Excel, using both built-in features and a simple VBA script.

Before we dive into the methods, ensure that your data is sorted. Removing duplicates becomes easier when your data is in order. So, use the 'Sort & Filter' option to arrange your data.

Using the 'Remove Duplicates' Feature

The 'Remove Duplicates' feature in Excel is a quick and easy way to delete duplicates. It's not perfect, as it only works when your data is sorted, and it removes entire rows rather than just the duplicate values. But it's a great starting point.

AD
How to Remove Duplicate Values in Excel Step by Step
How to Remove Duplicate Values in Excel Step by Step
How to Use VBA to Remove Duplicates in Excel - 6 Examples - ExcelDemy
How to Use VBA to Remove Duplicates in Excel - 6 Examples - ExcelDemy
Find Duplicates in Excel Instantly | Smart Formula Trick You Must Know 💥 | Excel Tips for Beginners
Find Duplicates in Excel Instantly | Smart Formula Trick You Must Know 💥 | Excel Tips for Beginners

To use this feature:

  1. Iselect the entire column containing the duplicate values.
  2. Go to the 'Data' tab in the Excel ribbon.
  3. Click on 'Remove Duplicates' in the 'Data Tools' group.
  4. A dialog box will appear. Ensure that the correct column is selected in the 'Column' list, then click 'OK'.

Manually Removing Duplicates with Mod operator

If you want to remove only the duplicate values, not the entire row, you can use the MOD operator. This will leave you with a clean column, but it will still leave you with multiple rows that contain the non-duplicate values.

How to Remove Duplicate Values in Excel: Step-by-Step Guide
How to Remove Duplicate Values in Excel: Step-by-Step Guide
Excel Remove Duplicates – Easy Step-by-Step Guide
Excel Remove Duplicates – Easy Step-by-Step Guide
How to Remove Duplicate Rows Based on One Column in Excel - ExcelDemy
How to Remove Duplicate Rows Based on One Column in Excel - ExcelDemy

To do this:

  1. Insert a new column to the left of your data.
  2. In the first cell of the new column, enter the formula `=COUNTIF($B$1:$B1, $B1)
  3. Drag this formula down to copy it to the rest of your data.
  4. In the 'Home' tab, click on 'Sort & Filter'

Using a Simple VBA Script

For a more robust solution, you can use a simple VBA script. This script will remove duplicate values and leave you with a clean column.

AD

To use this script:

EXCEL TIPS
EXCEL TIPS
Remove Duplicates in Excel Without Deleting Your Data! 🤯 | Advanced Filter Trick
Remove Duplicates in Excel Without Deleting Your Data! 🤯 | Advanced Filter Trick
the remove duplicate value poster shows how to use duplicate value in excel and other documents
the remove duplicate value poster shows how to use duplicate value in excel and other documents
How to Remove Duplicates in a Column in Excel (Step-by-Step Guide)
How to Remove Duplicates in a Column in Excel (Step-by-Step Guide)
How to Remove Duplicate Rows Based on One Column Using Excel VBA - ExcelDemy
How to Remove Duplicate Rows Based on One Column Using Excel VBA - ExcelDemy
Remove Duplicates
Remove Duplicates
  1. Press 'Alt + F11' to open the Visual Basic Editor.
  2. Go to 'Insert > Module' to create a new module.
  3. Paste the following code into the module:
Sub RemoveDuplicates() Dim LastRow As Long Dim i As Long LastRow = Cells(Rows.Count, 1).End(xlUp).Row For i = LastRow To 2 Step -1 If WorksheetFunction.CountIf(Range("A1:A" & LastRow), Cells(i, 1).Value) > 1 Then Rows(i).EntireRow.Delete End If Next i End Sub
  1. Close the Visual Basic Editor by clicking the 'X' in the top-right corner or by clicking 'File > Close and Return to Microsoft Excel'.
  2. Run the script by pressing 'Alt + F8', selecting 'RemoveDuplicates', and clicking 'Run'.

Removing duplicates from your Excel column can greatly improve the quality of your data and make it easier to work with. Whether you choose to use the built-in 'Remove Duplicates' feature, the MOD operator, or a VBA script, taking the time to clean up your data will pay off in the long run. Happy Exceling!

Remove Duplicates in Excel Fast
Remove Duplicates in Excel Fast
How to Find Unique Values in an Excel Column (6 Methods) - ExcelDemy
How to Find Unique Values in an Excel Column (6 Methods) - ExcelDemy
How to Delete Columns in Excel: Beginner’s Step-by-Step Guide
How to Delete Columns in Excel: Beginner’s Step-by-Step Guide
AD