如果单元格的值等于另一列的任何值,则有条件地格式化单元格 [英] Conditionally formatting cells if their value equals any value of another column

查看:18
本文介绍了如果单元格的值等于另一列的任何值,则有条件地格式化单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 AB 列中有数据.B 列的数据大部分是 A 数据的重复,但并非总是如此.例如:

I have data in the A and B columns. B column's data is mostly duplicates of A's data, but not always. For example:

A
Budapest
Prague
Paris
Bukarest
Moscow
Rome
New York

B
Budapest
Prague
Los Angeles
Bukarest

我需要在 A 列中搜索 B 中的值.如果一行匹配,我需要将 A 中该行的背景颜色更改为红色或其他颜色.

I need to search the A column for the values in B. If a row matches, I need to change the row's background colour in A to red or something.

推荐答案

这里是公式

基于公式以条件格式创建新规则.使用以下公式并将其应用于 $A:$A

create a new rule in conditional formating based on a formula. Use the following formula and apply it to $A:$A

=NOT(ISERROR(MATCH(A1,$B$1:$B$1000,0)))




这里是如果遇到问题可以下载的示例表

更新
这是 @pnuts 的建议,它也很完美:

UPDATE
here is @pnuts's suggestion which works perfect as well:

=MATCH(A1,B:B,0)>0


这篇关于如果单元格的值等于另一列的任何值,则有条件地格式化单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆