conditional formatting cells that have a match in another column

jbrown021286

Board Regular
Joined
Mar 13, 2023
Messages
61
Office Version
  1. 365
Platform
  1. Windows
Book3
ABCDE
5listrotagjobnotes
6620841462065192760motorwip
7620839562065954102motroodyssey motor
8620838362081552897control arm and subframe
9620815562083834529micu and keyless control unitwok
10620659562083955710done
11620651962084146538donedone
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B6Expression=COUNTIF(A:A,D6)>0textNO

i am looking to use a formula for conditional formatting. what i am wanting to do is highlight cells in column a that have a matching value in column b and visa Vesa. i am also wanting to highlight any cell in column a that does not have a match in column b (obviously in a different color). any help would be appreciated.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You are on the right track. For matches, I would use a formula like:
Excel Formula:
=AND(D6<>"",COUNTIF(A:A,D6)>0)

And for non-matches a new rule that looks something like:
Excel Formula:
=AND(D6<>"",COUNTIF(A:A,D6)=0)
 
Upvote 0
Book3
ABCDE
5listrotagjobnotes
6620841462065192760motorwip
7620839562065954102motroodyssey motor
8620838362081552897control arm and subframe
9620815562083834529micu and keyless control unitwok
10620659562083955710done
11620651962084146538donedone
121
131
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A6:A38Expression=AND(B1048576<>"",COUNTIF(A:A,B1048576)=0)textNO
B6:B38Expression=AND(A6<>"",COUNTIF(B:B,A6)>0)textNO
A6:A38Expression=AND(B6<>"",COUNTIF(A:A,B6)>0)textNO

looks like i did not apply it correctly where is my mistake?
 
Upvote 0
Look at your first formula. Your formula needs to line-up with the first cell in your selection (cell A6).
1712231470256.png


So the formula should be referencing row number 6, not row number 1048576.
 
Upvote 0
Book3
ABCDE
5listrotagjobnotes
61182760motorwip
712144102motroodyssey motor
814272897control arm and subframe
916474529micu and keyless control unitwok
10185710done
116538donedone
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Sheet1 (2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A6:A38Expression=AND(B6<>"",COUNTIF(A:A,B6)=0)textNO
B6:B38Expression=AND(A6<>"",COUNTIF(B:B,A6)>0)textNO
A6:A38Expression=AND(B6<>"",COUNTIF(A:A,B6)>0)textNO

i still dont seem to have it set up right. what i am wanting it to do is highlight in green the cells in column a that have a matching cell anywhere in column b. and the same for column b to column a then any cell without a matching value in column a to be highlighted red.
 
Upvote 0
I think you have the range references your formulas backwards.

For example for the first one, to apply to cells A6:A38, I think the formula should be:
Excel Formula:
=AND(A6<>"",COUNTIF(B:B,A6)=0)
and likewise for the other two.
 
Upvote 0
Solution
I think you have the range references your formulas backwards.

For example for the first one, to apply to cells A6:A38, I think the formula should be:
Excel Formula:
=AND(A6<>"",COUNTIF(B:B,A6)=0)
and likewise for the other two.
that got it thanks for the help
 
Upvote 0
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,215,256
Messages
6,123,915
Members
449,132
Latest member
Rosie14

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