Highlighting duplicated values using conditional formatting rule with formula

INN

Board Regular
Joined
Feb 3, 2021
Messages
118
Office Version
  1. 365
Platform
  1. Windows
Hi
I have 2 columns and I want to highlight duplicated values (using formula, I know there is an option to highlight without using formula).
So I highlighted these 2 ranges A1:A7 and B1:B7 and then wrote this formula in conditional formatting-->Formula

=COUNTIF(A1,$B1)>1

Appreciate any help. Thank you very much.

IDID
1​
1​
2​
3​
3​
5​
4​
7​
5​
9​
6​
11​
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
How about
Fluff.xlsm
AB
1IDID
211
323
435
547
659
7611
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B7Expression=COUNTIFS(A:A,B2)textNO
A2:A7Expression=COUNTIFS(B:B,A2)textNO
 
Upvote 2
Solution
I'm not clear on whether you want both Columns to be highlighted if there's a duplicate or just one of the columns.

Try highlighting the data cells ($A$2:$B$7) and enter this formula:
Excel Formula:
=COUNTIF($A$2:$B$7, A2)>1

This will highlight any value in both columns that is found in another cell within those two columns.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 1
Name your range, dynamically if needed. Be sure the cell reference in the formula is the active cell in the selected region. *took too long
1686853387526.png
 
Upvote 0

Forum statistics

Threads
1,215,352
Messages
6,124,457
Members
449,161
Latest member
NHOJ

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top