How to change the text color of one cell based on text in another group of cells

徘徊边缘 提交于 2019-12-13 09:37:00

问题


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.



来源:https://stackoverflow.com/questions/52407789/how-to-change-the-text-color-of-one-cell-based-on-text-in-another-group-of-cells

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!