How to remove duplicates and replace with blank cells in Excel?
Normally when you apply Remove Duplicates command in Excel, it removes the entire duplicate rows. But sometimes, you want the blank cells to replace the duplicate values, in this situation, the Remove Duplicate command will not work. This article is going to guide you remove duplicates and replace with blank cells in Excel.
If there are some duplicate data in a range, the following two formulas will guide you to remove all duplicates and leave blank cells in the range. Please do as follows:
1. In the adjacent blank cell, in the case, in cell D2, enter the formula =IF(A2="","",IF(COUNTIF($A2:A15,A2)=1,A2,"")). See screenshot:
2. Press Enter key, and click cell D2, and then drag the fill handle across to the range that you want to contain this formula. And the remaining values will keep the last item of the duplicates, others have been removed and leave blank cells. See screenshots:
3. As they are formulas, when you want to copy them, please paste as values.
Tip: If you need to replace all the duplicate values with blank cells and only keep the unique values, the following formula can help you: =IF(A2="", "", IF(COUNTIF(A$2:A$15,A2)>1,"",A2)), and then you will get the following results:
Note: You can replace cell references in above two formulas according to your case.
Remove duplicates and replace with blank cells with Kutools for Excel
The Select Duplicate & Unique Cells utility of Kutools for Excel can help you quickly select the duplicate values in a range. On the other hand, with this utility, you can also compare two ranges, and select all duplicates in one range at once.
3. In the Select Duplicate & Unique Cells dialog box, select Duplicates (Except 1 st one) or All duplicates (Including 1 st one) as you need. See screenshot:
4. Then click OK, if you select Duplicates (Except 1 st one) option, the duplicate values have been selected which not contain the values appear for the first time. And then press the Delete key to remove them. See screenshots:
5. If you select All duplicates (Including 1 st one) option, all the duplicate values which contain the values appear for the first time, and only leave the unique values. And then press the Delete key to remove them. See screenshots:
Note: Select entire rows: With this option, the entire rows which contain the same values will be selected.
Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
More than 300 powerful features. Supports Office/Excel
2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features
30-day free trial. 60-day money back guarantee.
Hi really need help, i having the same problem however i need the first data and clear out any succeeding duplicates. Like if i have 5 "jane" in a range, i would need 1 "jane"(the very first in line) and delete the rest. I see with the given solution that it actually delete all 5 "jane"s.
Sub RemoveDupes() Dim X As Long For X = 1 To Range("A" & Rows.Count).End(xlUp).Row If Application.WorksheetFunction.CountIf(Range("A1:A" & X), Range("A" & X).Text) > 1 Then Rows(X).ClearContents Next End Sub
It works for me.
Thanks to Blade Hunter [url]http://www.mrexcel.com/forum/excel-questions/768398-how-remove-duplicates-replace-blank-cells-excel.html#post3766476[/url]