简体   繁体   中英

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. In a row if a cell contains "ABC" and "Yes" in another I want the Yes cell highlighted.

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.

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(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.

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.

=AND($A1="ABC",$B1="Yes")

In cell A1 , I've put ABC , and in B1 , I've put Yes .

Then I used following formula in another cell's conditinal formatting:

=AND(EXACT(A1;"ABC");EXACT(B1;"Yes"))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM