Excel:比较和格式化单元格

Excel: compare and format cells

我有 2 个具有不同值的列。 我希望完成的是:

1. if value of any cell in A is not in any cell of B > make cell blue
2. if value of any cell in B is not in any cell of A > make cell yellow
3. if value of any cell in A is also in any cell of B > make cell green

在B2中找到A2,使A2和B2都变绿

A3不在B中,使A3变蓝

在 B3 中找到 A4,将两者设为绿色

B8不在A中,使B8变黄

A8不在B中,使A8变蓝

我希望这是有道理的,并且可以通过条件格式设置。我想不出用于此的公式。任何帮助将不胜感激。

请 select A2:A8,主页 > 样式 - 条件格式,新规则...,使用公式确定要格式化的单元格格式化满足此公式的值:

=MATCH($A2,$B:$B,0)  

使用绿色格式和另一条规则:

=ISERROR(MATCH($A2,$B:$B,0))  

蓝色格式。

Select B2:B8 并重复以上内容:

绿色:=MATCH($B2,$A:$A,0) 和黄色:=ISERROR(MATCH($B2,$A:$A,0))