## Highlight unique distinct records

The image above demonstrates a Conditional Formatting formula that highlights unique distinct records. This means that the first instance of each record is highlighted, however, every duplicate is not highlighted.

Example, Row 13 shown in the image above has a duplicate in row 5. Row 5 is the first instance of that particular record and is highlighted but row 13 is a duplicate and is not highlighted.

I have also written an article about how to extract unique distinct records and counting unique distinct records.

Conditional formatting formula:

### Explaining condtional formatting formula in cell B3

The COUNTIFS function calculates the number of cells across multiple ranges that equals all given conditions, it has at least one pair of a *criteria1* argument and *criteria_range1* argument.

COUNTIFS(*criteria_range1*, *criteria1*, [*criteria_range2*, *criteria2*]…)

In this example we have four columns so 4 pairs are needed to calculate if a record is unique distinct or not.

#### Step 1 - Absolute and relative cell references

The first argument in the COUNTIFS function is the *criteria_range1 *and I am using this cell reference: $B$3:$B3

The first part is locked to column B and row 3. $B$3 The second part is only locked to column B, the row number changes as the conditional formatting moves on to the next cell below.

This makes the cell reference grow as the conditional formatting moves to cells below.

The same basic technique is used with the other cell references in the COUNTIFS function.

#### Step 2 - Count records

COUNTIFS($B$3:$B3, $B3, $C$3:$C3, $C3, $D$3:$D3, $D3, $E$3:$E3, $E3)

becomes

COUNTIFS("Sample0", "Sample0", "B", "B", 11, 11, "AA111", "AA111")

and returns 1.

#### Step 3 - Check if count is equal to 1

COUNTIFS($B$3:$B3, $B3, $C$3:$C3, $C3, $D$3:$D3, $D3, $E$3:$E3, $E3)=1

becomes

1=1

and returns TRUE. Cell B3 is highlighted.

### Download Excel file

Enter your email to receive the workbook.Highlight overlapping date ranges using conditional formatting

The image above demonstrates a conditional formatting formula that colors a record if there is at least one record that […]

Highlight records based on overlapping date ranges and a condition

adam asks: Hi, I have a situation where I want to count if this value is duplicate and if it […]

Highlight dates in a date range

Question: How do I highlight dates that meet criteria using conditional formatting? Table of contents Highlight values in a column […]

This post demonstrates how to highlight records with the closest value to a criterion, you can also choose to highlight […]

This blog post shows you how to easily identify duplicate rows or records in a list. Conditional formatting formula: =COUNTIFS($B$3:$B$15, […]

### Leave a Reply

### How to comment

**How to add a formula to your comment**

<code>Insert your formula here.</code>

**Convert less than and larger than signs**

Use html character entities instead of less than and larger than signs.

< becomes < and > becomes >

**How to add VBA code to your comment**

[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org or imgur

Paste image link to your comment.

**Contact Oscar**

You can contact me through this contact form