How to Replace Duplicates with Blank Cells in Excel

This post will guide you how to remove duplicates and replace with blank cells in Excel 2013/2016. How do I replace the duplicates with blank cells using a formula in Excel.

Replace Duplicates with Blank Cells


Assuming that you have a list of data in range B1:C4, and you want to remove duplicate values in this range of cells and replace it with blank cells. How to achieve it.  And if you just use the Remove Duplicates command, it will remove all duplicate rows only. So you can use a formula to remove duplicates and replace it with blank cell based on the IF function, and the COUNTIF function.

Just like this:

=IF(B1="","",IF(COUNTIF($B1:B4,B1)=1,B1,""))

Type this formula into a blank cell, such as: D1 and press Enter key in your keyboard, and then drag the AutoFill Handle down to Cell F4 to apply this formula.

replace duplicates with blanks1

Show Only Duplicate Values


If you want to replace all unique values with blank cells and only show duplicates values in Excel, you can use another formula based on the IF function and COUNTIF function. Like this:

=IF(B1="","",IF(COUNTIF($B1:B4,B1)>1,B1,""))

Type this formula into a blank cell and then drag the AutoFill Handle down to other cells to apply this formula.

Let’s see the result:

replace duplicates with blanks2

Show Only Unique Values


If you want only to show the unique values and remove all duplicate values and replace with blank cells in Excel, you can use the following formula based on the IF and COUNTIF function.

=IF(B1="", "", IF(COUNTIF(B$1:B$4,B1)>1,"",B1))

replace duplicates with blanks3

Video: Replace Duplicates with Blank Cells

 

Related Functions


  • Excel IF function
    The Excel IF function perform a logical test to return one value if the condition is TRUE and return another value if the condition is FALSE.The syntax of the IF function is as below:= IF (condition, [true_value], [false_value])…
  • Excel COUNTIF function
    The Excel COUNTIF function will count the number of cells in a range that meet a given criteria. This function can be used to count the different kinds of cells with number, date, text values, blank, non-blanks, or containing specific characters.etc.= COUNTIF (range, criteria)…

Comments

So empty here ... leave a comment!

Leave a Reply

Your email address will not be published. Required fields are marked *

Sidebar