Question

I have a (probably) simple problem but I just couldn't figure it out.

I have an Excel workbook (Google AdWords report), with just one sheet and simple data in many rows and columns. No formulas, just raw values like numbers, text and percentages.

I wish to color whole row red if a value in that row in a certain column equals something.

For example:

Case 1.
IF value in column C <= 1.5% THEN color row RED; /cell C25 is 1.41% row 25 gets colored red/

Case 2.
IF value in column F begins with text "Below first page..." (theres more but it always begins with this) THEN color row ORANGE

I have absolutely no experience with VBA but do know just a little bit of PHP and CSS so the principles just might come in handy (I hope). This is the reply someone gave here on SA, Coloring complete Row based on values from Columns but I coudn'T get that one to work

Was it helpful?

Solution

This can be done with conditional formatting. Select all the cells you want affected (start selecting from the top of your range, I assume it starts at row 1), then go to

Home tab > Styles group > Conditional Formatting > New Rule > Use formula to determine which cells to format

For Case 1, chose your desired format and set the formula as follows:

=$C1<1.5%

Repeat the process for Case 2 and set the formula as follows:

=LEFT($F1,17)="Below first page…"

Note that when using conditional formatting, a range of cells is selected but there is one corner cell in focus (the white one). When you enter the formula, the conditional formatting is applied to the focus cell using your formula. It is then filled to the remaining cells in your range. Hence, if your range starts on row 2, you need to change $C1 to $C2 and $F1 to $F2.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top