I have two columns with names. I would like to change color on the corresponding cell where value is not the same as in first column.
我有两个名字列。我想改变相应单元格的颜色,其中值与第一列中的值不同。
A B
1 Lars Lars
2 Erik Erik
3 Niels Jens
4 Brian Brian
In the above case B3 should be highlighted.
在上述情况下,应突出显示B3。
I have looked all over (really - all over) the internet - and the closest I got was Column A to be highlighted if there was a difference.
我已经看了很多(真的 - 全部)互联网 - 如果有区别的话,我得到的最接近的是A栏。
2 个解决方案
#1
#2
1
My approach would be to select column B, go to Conditional Formatting > New Rule > Use formula to determine which cells to format, and then I would put in the following formula:
我的方法是选择B列,转到条件格式>新规则>使用公式来确定要格式化的单元格,然后我将输入以下公式:
=D1<>C1
Please, note that this is without dollar signs, this is very important.
请注意,这是没有美元符号的,这一点非常重要。
#1
2
You can use formula in conditional formatting. I have used VLOOKUP
You can use MATCH
as well
您可以在条件格式中使用公式。我使用过VLOOKUP你也可以使用MATCH
=ISERROR(VLOOKUP(B1,$A:$A,1,0)<>B1)
#2
1
My approach would be to select column B, go to Conditional Formatting > New Rule > Use formula to determine which cells to format, and then I would put in the following formula:
我的方法是选择B列,转到条件格式>新规则>使用公式来确定要格式化的单元格,然后我将输入以下公式:
=D1<>C1
Please, note that this is without dollar signs, this is very important.
请注意,这是没有美元符号的,这一点非常重要。