Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to sort numbers or texts and remove the duplicate records directly in Excel?

If there is a list of numbers or texts with some duplicates, the duplicate ones will be sorted together while using the Sort function in Excel. However, in some cases, you just want to sort the data and remove the duplicate records directly, how can you deal with this job?
doc sort remove duplicates 1

Sort numbers and remove the duplicate ones

Sort texts and remove the duplicate ones

Easily Combine multiple sheets/Workbook into one Single sheet or Workbook

To combinne multiples sheets or workbooks into one sheet or workbook may be edious in Excel, but with the Combine function in Kutools for Excel, you can combine merge dozens of sheets/workbooks into one sheet or workbook, also, you can consolidate the sheets into one by several clicks only.  Click for 60 days free trial!
combine sheets
Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days.

Sort numbers and remove the duplicate ones

To sort numbers and remove duplicates, you need some formulas to help you.

1. Firstly, you need to identify the duplicate rows by using this formula =COUNTIF(A2:A$11,"="&A1), A1 is the first number in the list, A11 is the cell below the last number of the list. Drag auto fill down to fill cells with this formula.
doc sort remove duplicates 2

2. Then in adjacent column, type this formula =IF(B1=0,A1,"") B1 is the first formula cell, drag fill handle down to sort the numbers. Duplicates will be displayed as blank.
doc sort remove duplicates 3

3. In next column, use =SMALL(C$1:C$10,ROW(C1)-ROW(C$1)+1) to sort numbers from smallest to largest and remove duplicate ones. C1:C10 is the third formula range.
doc sort remove duplicates 4


1. If you want to sort numbers from largest to smallest, you can use this formula =LARGE(C$1:C$10,ROW(C1)-ROW(C$1)+1).
doc sort remove duplicates 5

2. You can apply the Error Condition Wizard of Kutools for Excel, select Any error value from Error types drop down list to convert errors to blanks or message as you need.
(Free Download Kutools for Excel Now!) doc sort remove duplicates 6

Sort texts and remove the duplicate ones

If you want to sort texts and remove the duplicate values, you also need some formulas.

1. Firstly, add a series of numbers adjacent to the text list.
doc sort remove duplicates 7

2. In the column C, type this formula =IF(COUNTIF(B12:B$21,B12)=1,B12,"") (B12:B21 is the text range) to extract the unique texts.
doc sort remove duplicates 8

3. In the column D, type this =COUNTIF(C$12:C$21,"<"&C12) to sort the unique texts. In this case, duplicates will be displayed as zeros.
doc sort remove duplicates 9

4. In column E, type this formula =MATCH(A12,D$12:D$21,0), the zeros will be displayed as errors. A12 is the first number of the series number, D12:D21 is the third formula range.
doc sort remove duplicates 10

5. In column F, type this formula =INDEX(B$12:B$21,E12), B12:B21 is the text range, E12 is the first cell of previous formula range. Now the duplicate ones shown as errors, and only unique texts are sorted.
doc sort remove duplicates 11

Tip: You also can apply the Error Condition Wizard of Kutools for Excel to convert Only the #N/A error value to blanks.(Free Download Kutools for Excel Now!)
doc sort remove duplicates 12

Tabbed browsing & editing multiple Excel workbooks/Word documents as Firefox, Chrome, Internet Explore 10!

You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Excel workbooks or Word documents in one Excel window or Word window, and easily switch between them by clicking their tabs. Click for free 45-day trial of Office Tab!

ot excel

Recommended Productivity Tools for Excel

Kutools for Excel Helps You Always Finish Work Ahead of Time, and Stand Out From Crowd

  • More than 300 powerful advanced features, designed for 1500 work scenarios, increasing productivity by 70%, give you more time to take care of family and enjoy life.
  • No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
  • Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds, 
  • Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 highly effective people and 300+ world-renowned companies' choice.
  • 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

Brings Tabbed Browsing and Editing to Microsoft Office, Far More Powerful Than The Browser's Tabs

  • Office Tab is designed for Word, Excel, PowerPoint and Other Office Applications: 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!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.