# compare two columns and highlight the matches

#### assino

##### New Member
Hello everyone

i'm searching how to Compare two columns and highlight matches
there is many different ways but what i want is to highlight one cell if there is only 1 cell that contains the same value on the other column
for example :
if there is 2 cells that contains "x" in column 1, and 3 "x" in column 2, i want to highlight two cells in each column,
what i want as result that the sum of highlighted cells in A = to the highlighted cells in B.

### Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

#### Fluff

##### MrExcel MVP, Moderator
Hi & welcome to MrExcel.
+Fluff New.xlsm
AB
1
2AM
3BD
4CI
5DP
6RQ
7FR
8GS
9RT
10II
11JD
12DW
13LX
Master
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B13Expression=COUNTIFS(B\$2:\$B2,B2)<=COUNTIFS(A\$2:A\$13,B2)textNO
A2:A13Expression=COUNTIFS(A\$2:\$A2,A2)<=COUNTIFS(B\$2:B\$13,A2)textNO

#### assino

##### New Member
Hi & welcome to MrExcel.
+Fluff New.xlsm
AB
1
2AM
3BD
4CI
5DP
6RQ
7FR
8GS
9RT
10II
11JD
12DW
13LX
Master
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B13Expression=COUNTIFS(B\$2:\$B2,B2)<=COUNTIFS(A\$2:A\$13,B2)textNO
A2:A13Expression=COUNTIFS(A\$2:\$A2,A2)<=COUNTIFS(B\$2:B\$13,A2)textNO
Hi,

#### Fluff

##### MrExcel MVP, Moderator
You're welcome & thanks for the feedback.

Replies
3
Views
47
Replies
11
Views
109
Replies
17
Views
242
Replies
6
Views
132
Replies
1
Views
130

1,127,210
Messages
5,623,410
Members
415,972
Latest member
SY1234

### 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.

### Which adblocker are you using?

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

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