[英]Conditional Formatting, Highlight Cell if it Contains Specific Text in 2 Cells
I'm trying to highlight a cell using conditional formatting based on matching criteria in 2 different cells, 1 of which is the cell I want highlighted.我正在尝试使用基于 2 个不同单元格中的匹配条件的条件格式突出显示一个单元格,其中 1 个是我要突出显示的单元格。 In a row if a cell contains "ABC" and "Yes" in another I want the Yes cell highlighted.
如果一个单元格在另一个单元格中包含“ABC”和“是”,我希望突出显示“是”单元格。
I've yet to be able to figure out how to get this to work after searching and searching formulas.在搜索和搜索公式后,我还没有弄清楚如何让它工作。 I've tried different IF, AND, etc formulas to no avail.
我尝试了不同的 IF、AND 等公式,但无济于事。
Apply the conditional format to the cell that you want to be formatted.将条件格式应用于要设置格式的单元格。 Use a conditional format with a formula.
使用带有公式的条件格式。 If you want to evaluate two different cells, you can use the AND() function to combine conditions, for example select cell B and use this CF formula
如果要评估两个不同的单元格,可以使用 AND() function 组合条件,例如 select 单元格 B 并使用此 CF 公式
=AND(A1="ABC",B1="Yes")
This formula will evaluate to either TRUE or FALSE and the conditional format will be applied when the result is TRUE.此公式将评估为 TRUE 或 FALSE,并且当结果为 TRUE 时将应用条件格式。
If you want the whole row to change color, select all the cells in row 1 and make sure that the formula locks in the correct columns with the $ sign.如果您希望整行更改颜色,select 第 1 行中的所有单元格,并确保公式使用 $ 符号锁定在正确的列中。
=AND($A1="ABC",$B1="Yes")
In cell A1
, I've put ABC
, and in B1
, I've put Yes
.在单元格
A1
中,我输入了ABC
,在B1
中,我输入了Yes
。
Then I used following formula in another cell's conditinal formatting:然后我在另一个单元格的条件格式中使用了以下公式:
=AND(EXACT(A1;"ABC");EXACT(B1;"Yes"))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.