# Thread: Conditional Formatting (2007 SP1)

1. ## Conditional Formatting (2007 SP1)

I would like to setup a Template that checks a Column for 1 of 4 conditions and then colors the entire row accordingly.
Eg, If A1 = Environment, the whole row should be green. If A1 = Workplace, the whole row should be red, etc, etc.
Then copy this throughout the whole workbook, ie if A2, A3, A4, etc, contain Environment, color the whole row green. If they contain Workplace, color the whole row red, etc

I've spent an hour messing around with Conditional Formatting but can't get this to work. Does this require code, or is there a formula that I have to place in every cell in the workbook (or just column A)?

Thanks for any advice. I looked at a similar Conditional Formatting "Days of the Week" question on this Forum , but I couldn't extrapolate from that as I assume Excel uses reserved words, and I need to be able to get Excel to evaluate against at least 4 words before returning True.

Thanks again.

2. ## Re: Conditional Formatting (2007 SP1)

You can have 4 colors but only 3 conditions. You can use the 3 conditions to get 3 colors but the 4th color would have to be the explicit color set when none of the conditons apply.

You would select the range and set the condition to
=\$A1 = "Environment" and set the format to green
=\$A1 = "Workplace" and set the format to red
=\$A1 = "Othert" and set the format to blue
Then set the format for all the range to orange so if it is not one of the 3 conditions you will have the 4th color.

If you truly need 4 conditions you will have to do it with code

Steve
PS <post:=716,424>post 716,424</post:> has some example code

3. ## Re: Conditional Formatting (2007 SP1)

Thanks! Excel 2007 lets me have 4 conditions, and it's working well.