简体   繁体   中英

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

I'm trying to fill in the color of a cell based on specific text from another cell. For ex. if the cell I'm trying to fill in with the color red is A1 based on the text "Red" in cell B1 which has the words Red Rock in the cell how can I fill in A1 with the color red? I know the conditional formatting formula for filling in a cell based on an exact word would be Rule $A1="Red" Applies to =$B$1, but this does not work if the cell contains anything more than Red, which in this case would be Red Rock.

Let me know if what I'm trying to do makes sense or is even possible.

Thanks

Try using search in the conditional fomating

Conditional Formating --> Use formula to determine which cells to format

Key-in this in the formula bar and select red color

=ISNUMBER(SEARCH("RED",B1))

Select the cell to format (example A1)

In New Formatting Rule dialog box, choose "use formula to determine which cells to format" and try to use the following: =SEARCH("red",$B$1)

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