Randy Bailey
Randy Bailey

Reputation: 31

Conditionally format Google Sheets cell based on text in a different cell

I would like to format cell D2 based on text in C2. I would like D2 to be colored Red if C2 contains text from a drop down of "No" and be colored Green if the text is "Yes". I have tried custom formula containing =IF C2 ("Yes") which Google Sheets seems to accept but he result is not displayed at all.

Upvotes: 1

Views: 30251

Answers (3)

motty feferkorn
motty feferkorn

Reputation: 1

if you want to conditional format based on part of a text in another cell the custom formula is =G2> "TEXT"

Upvotes: 0

Alan Wells
Alan Wells

Reputation: 31300

Edit: Actually, if the cell is to have a background of white for anything other than "Yes", then you only need one rule: =C2="Yes" That is, if the default background for the entire sheet is white.

You must add two separate rules to cell D2, one for each color. The formula must look like this:

=$C$2="Yes"

And for anything other than "Yes"

=$C$2<>"Yes"

Upvotes: 2

user4039065
user4039065

Reputation:

  1. Select D2 (or D2:D9 or D2:<somewhere further down>)
  2. Choose Format ► Conditional Formatting
  3. Format cells if... Custom formula is...
            =C2="yes"
  4. Formatting style - choose a green Fill and click Done.
  5. Add new rule then repeat from step 3 with `=C2="no" and a red Fill.

            c2isNo

Upvotes: 5

Related Questions