How to change the text color of one cell based on

2020-01-18 22:32发布

问题:

I am having difficulties being able to change the color of text in a particular cell based on what is written in a different group of cells. Ex. The text in E8 is to change to green if that exact text is found in any one of the cells in F3:F5. I have been able to do this for individual cells =SEARCH("text"$F$3) but I am having trouble writing for a group of cells. Do I need to have 3 separate rules for this one cell? or is there a way to only have one rule?

Thanks

回答1:

You can use conditional formatting. The rule you want to create is:

=COUNTIF($F$3:$F$5,"text")

(Note: This is not case sensitive)



回答2:

Provided you really only want this for a single cell, a slightly shorter formula:

=COUNTIF(F3:F5,E8)

to be applied by selecting E8, clearing any exiting CF from it and and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true: as above, then Format..., select green fill, OK, OK.