Skip to main content

How to remove all duplicates but keep only one in Excel?

Author: Sun Last Modified: 2020-05-08

This tutorial introduces the tricks to remove all duplicate values from a list but keep only one in Excel, read the details:

Remove all duplicates but keep only one with Remove Duplicates function

Remove all duplicates but keep only one with VBA

Remove all duplicates but keep only one with Kutools for Excel good idea3

Combine all duplicate rows and keep data with Kutools for Excel good idea3


In Excel, the Remove Duplicate feature can help you remove all but keep one duplicate value.

1. Select the data list you need, and click Data > Remove Duplicates. See screenshot:

doc remove duplicate keep one 1

2. Then in Remove Duplicates dialog, check the column name that you want to remove duplicates from, and if your data has header, check My data has headers option, too. See screenshot:

doc remove duplicate keep one 2

3. Click OK. And a dialog pops out to tell you how many duplicates have been removed, just close it. And now all duplicates have been remove but keep only one in the list.

doc remove duplicate keep one 3


If you are interested in VBA, here I also can introduce a VBA code to solve this task.

1. Press Alt +F11 keys simultaneously to open Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste below VBA to the new Module window.

VBA: Remove all duplicates but keep one.

Sub RemoveAllDeplicateButOne()
    Dim LR As Long: LR = Range("A" & Rows.Count).End(xlUp).Row
    ActiveSheet.Range("A1:A" & LR).RemoveDuplicates Columns:=1, Header:=Name
End Sub

3. Press F5 key or click Run to execute the VBA, and the duplicates in list in column A have been removed but keep one.

Tip: In the above VBA, A indicates the column A, and A1: A indicates the list range, you can change them as you need.


There is a powerful utility in Kutools for Excel named Select Duplicate & Unique Cells can quickly select or highlight all duplicates except first one, and then you can remove them.

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After free installing Kutools for Excel, please do as below:

1. Select the data range and click Kutools > Select > Select Duplicate & Unique Cells. See screenshot:

doc remove dulicate keep one 15

2. In the displayed dialog, check Duplicates (Except 1st one) option, and click Ok. See screenshot:

doc remove duplicate keep one 5

3. Then a dialog pops out to remind you the number of selected cells. And just click OK to close it. See screenshot:

doc remove duplicate keep one 6

4. And all the duplicates but first one are selected, press Delete key to clear them.

doc remove duplicate keep one 7

Tip: You also can remove all duplicates but keep one with Select Duplicate & Unique Cells like this:

Select all the unique values including the first duplicates, and then copy them by pressing Ctrl + C and paste to another location by Ctrl + V.

doc remove duplicate keep one 8doc remove duplicate keep one 9

If you have some data, and what you want is to combine the duplicate rows then keep the corresponding data as below screenshot shown, you can use Kutools for Excel’s Advanced Combine Rows function.

doc remove duplicate keep one 10

After free installing Kutools for Excel, please do as below:

1. Select the data and click Kutools > Merge & Split > Advanced Combine Rows. See screenshot:

doc remove dulicate keep one 16

2. In the Combine Rows Based on Column dialog, select the column you want to remove duplicate from and click Primary Key to make it as the primary key column. See screenshot:

doc remove duplicate keep one 12

3. Then select the column you just want to keep the data and then click Combine, and select one delimiter form the list. See screenshot:

doc remove duplicate keep one 13

4. Click Ok, and the duplicate rows are combine and keep the corresponding data.

doc remove duplicate keep one 14


Relative Articles:

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

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...

Description


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!
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations