How to remove duplicates in excel column
Tutor 5 (54 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
Excel provides five methods to remove duplicates from a column: the Remove Duplicates command, Advanced Filter, Conditional Formatting with manual deletion, the UNIQUE function, and the helper column formula approach. Each method suits different workflows depending on whether you need to preserve original data, work with dynamic results, or handle large datasets.
What is the remove duplicates command in Excel?
The Remove Duplicates command is a built-in Excel feature located in the Data tab that permanently deletes duplicate rows while keeping the first occurrence of each value. This command alters the original dataset, so copying data before use is recommended for preserving source integrity
Steps to use the remove duplicates command
- Select the range or column containing duplicates. The selection should not contain outlines or subtotals.
- Navigate to the Data tab and click Remove Duplicates in the Data Tools group.
- The Remove Duplicates dialog box opens, displaying all columns in the selection with checkboxes.
- Check the boxes for columns you want to evaluate for duplicates. Select only your target column for single-column deduplication.
- Verify the "My data has headers" checkbox. Excel auto-detects headers when the top row contains text labels.
- Click OK to execute the removal.
Understanding the completion message
Excel displays a confirmation dialog stating the number of duplicates removed and unique values remaining. An example message reads: "1 duplicate value was removed. 3 unique values remain." The original data updates instantly upon clicking OK.
How to use advanced filter to extract unique values
The Advanced Filter method copies unique records to a new location without modifying original data. This approach preserves source integrity during validation processes.
Steps to set up advanced filter
- Select the data range including headers to define the List range.
- Go to Data tab, then Sort & Filter group, then click Advanced.
- The Advanced Filter dialog box opens with options for Action, List range, Criteria range, and Copy to.
- Choose "Copy to another location" in the Action section.
- Enter or confirm the List range (example: $A$1:$A$20).
- Specify the Copy to destination as an empty cell (example: $D$1) for output location.
- Check "Unique records only" to filter duplicates.
- Click OK.
Unique values copy to the destination with headers intact. The original data remains unchanged.
How to highlight and delete duplicates using conditional formatting
Conditional Formatting highlights duplicate values for visual review before removal. This non-destructive preview allows verification before permanent changes.
Steps to highlight duplicates
- Select the column or range containing potential duplicates.
- Navigate to Home tab, then Styles group, then Conditional Formatting.
- Select Highlight Cells Rules, then Duplicate Values.
- Choose a highlight style (example: Light Red Fill with Dark Red Text) in the dialog box.
- Click OK. Duplicates receive the selected formatting instantly.
Steps to delete highlighted duplicates
- With highlights visible, go to Data tab, then Sort & Filter, then click Filter (or press Ctrl+Shift+L).
- Click the column filter dropdown arrow.
- Uncheck "Select All," then select only the highlighted color under Filter by Color.
- Select the filtered rows, right-click, and choose Delete Row.
- Turn off filters by clicking Filter again.
- Clear formatting through Home, then Conditional Formatting, then Clear Rules, then Clear Rules from Selected Cells.
How to use the UNIQUE function in Excel
The UNIQUE function dynamically extracts unique values from a column into a spill range that updates automatically. This function is available in Excel 365, Excel 2021, and Excel for the web.
Syntax
The syntax is =UNIQUE(array, [by_col], [exactly_once]).
Array (required): The column range from which to extract unique values (example: A2:A100).
By_col (optional): A logical value specifying comparison direction. FALSE (default) compares by rows. TRUE compares by columns.
Exactly_once (optional): A logical value defining uniqueness criteria. FALSE (default) returns all distinct values. TRUE returns only values appearing exactly once.
Steps to use the UNIQUE function
- Select an empty cell adjacent to your data column (example: B2).
- Enter =UNIQUE(A:A) or =UNIQUE(A2:A100) to target the column. Adjust the range to exclude headers when needed.
- Press Enter. Unique values spill downward automatically into adjacent cells.
- Copy the spilled results and paste as values elsewhere for a static list.
The UNIQUE function returns an array that spills if it is the final result of a formula. Excel dynamically creates the appropriate sized array range when you press Enter.
How to remove duplicates using a helper column formula
The helper column method uses a COUNTIF formula to flag duplicates by counting occurrences up to the current row. This approach retains the first instance while identifying repeats for targeted deletion.
Formula logic
The formula =COUNTIF($A$1:A1,A1) counts how many times the value in A1 appears from the start of the range down to the current row. The mixed reference ($A$1:A1) locks the start cell while expanding the end cell as the formula is dragged down. First occurrences return 1. Subsequent duplicates return 2, 3, or higher.
Steps to implement the helper column method
- Insert a blank column next to the target data column (example: column B).
- In cell B1 (assuming row 1 contains headers, use B2 for data starting in row 2), enter =COUNTIF($A$1:A1,A1).
- Drag the formula down to cover all data rows using the fill handle.
- Apply filters through Data, then Filter.
- Click the helper column dropdown arrow.
- Uncheck 1 and select values greater than 1 (2, 3, etc.) to show only duplicates.
- Select the filtered rows, right-click, and choose Delete Row.
- Remove the filter and delete the helper column.
- Copy and paste the unique list as values for a static result.
Key considerations for choosing a method
Data preservation: The Remove Duplicates command permanently deletes data. The Advanced Filter and UNIQUE function preserve original data. Conditional Formatting and the helper column method allow review before deletion.
Excel version compatibility: The UNIQUE function requires Excel 365 or Excel 2021. The Remove Duplicates command, Advanced Filter, Conditional Formatting, and helper column formulas work in Excel 2016 and later versions.
Dynamic versus static results: The UNIQUE function produces dynamic results that update when source data changes. All other methods produce static results that require manual re-execution after data changes.
Large dataset handling: The Remove Duplicates command processes large datasets efficiently through built-in optimization. The COUNTIF helper column method may slow performance on datasets exceeding 100,000 rows due to expanding range calculations.
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to show duplicates in red
Answers · 1
How to apply duplicate conditional formatting rule
Answers · 1
How to duplicate conditional formatting excel
Answers · 1
What is excel conditional formatting duplicates
Answers · 1