How to remove everything but duplicate rows in Excel?
Maybe, there are some duplicate values in a column of your worksheet, and now, you want to remove non-duplicate values and keep only the duplicate records in the column. Do you have any good ideas to solve this problem in Excel? In this article, I will talk about how to quickly and easily remove all but keeping the duplicate rows in Excel.
Remove all unique values and keep only the duplicates:
With Kutools for Excel's Select Duplicate & Unique Cells feature, you can quickly select the duplicate or unique values in a list and then you can format, copy or delete them as you need.
Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!
To remove the non-duplicate rows, you need to create a formula helper column first, and then filter all the unique values based on your helper column, finally, delete the filtered unique values. Please do as follows:
1. Enter this formula =COUNTIF($A$2:$A$15, A2)=1 into a blank cell besides your data, such as cell B2, see screenshot:
Tip: In the above formula, A2:A15 is the column range you want to remove the unique values, you can change it as you need.
2. And then drag the fill handle down to the cells that you want to apply this formula, False indicates the duplicate values and True stands for the unique values, see screenshot:
3. Then select the data range and click Data > Filter, see screenshot:
4. Click the filter drop-down in the new helper column B and uncheck FALSE option to just show the unique values of column A, and then click OK button, see screenshot:
5. After showing only the non-duplicate records, select the entire rows of these visible rows, and then click Home > Find & Select > Go To Special, in the Go To Special dialog box, select Visible cells only option, see screenshots:
6. Then click OK to close the dialog box, and only the visible rows have been selected as following screenshot shown:
7. And then you need to remove these visible rows only, put the cursor at the selected rows, right click to choose Delete Row from the context menu, see screenshot:
8. And only the visible rows are deleted at once, then you need to cancel the filter by clicking Data > Filter again to disable the Filter function, and you can see all the unique value rows have been removed, and only leave the duplicate records, see screenshot:
9. At last, you can delete the content of helper column B as you want.
With above method, there are so many steps needed to be followed, if you have a handy tool – Kutools for Excel, it may save you a lot of time.
|Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.|
After installing Kutools for Excel, please do as follows:
1. Select the data range that you want to use.
2. Then click Kutools > Select > Select Duplicate & Unique Cells, see screenshot:
3. In the Select Duplicate & Unique Cells dialog box, select Unique values only under the Rule section, and check Select entire rows option, see screenshot:
4. Then click OK button, and a prompt box will pop out to remind you how many rows have been selected:
5. And then click OK to close theses dialogs, and all the unique value rows have been selected, see screenshot:
6. Then you just need to remove theses selected rows, click Home > Delete > Delete Sheet Rows, see screenshot:
7. And all the selected unique rows have been deleted immediately.
With this Select Duplicate & Unique Cells feature, you can also finish the following tasks: