Conditional formatting question

Hi,

I am looking on a way to set the background color of a full row if one specific field in the row has a value.

So, if the value is in col C, this would be the result:

  A B C D E
1 x y 8 p
2 x2 y2 6 c
3 x3 y3 3 7 f
4 x4 y4 9 g

I looked at conditional formatting but I don't see how to format the complete line based on one value in the line

Does someone of you bright minds have an idea how to accomplish this?

Thanks,
Rob.

By "having a value", do you mean the specific example value of 3, or do you mean having value as distinct from not having a value (whatever that means)?

o Select the relevant rows.
o Go to Format | Conditional Formatting... .
o For Condition 1, select "Formula is" from the drop-down menu.
o In the box, enter INDIRECT("$C"&ROW())=3 - or perhaps INDIRECT("$C"&ROW())<>0 .
o For Cell Style, select your cell style with the appropriate background colour (or click New Style... and create a style on the fly).
o OK.

I trust this helps.

Brian Barker

1) Select the area in question.
2) Notice the row of the active cell.
3) Change "Value is" to "Formula is"
4) ISNUMBER($C1) where the 1 refers to the active cell's row.
5) Choose your cell style to be applied when the condition is true.

The condition actually tests if this relative row's value in absolute
column C is a number.

Andreas & Brian,

thanks, that works great!

Now I have another followup question:

I already had a formatting for 2 colums where I set the number of digits behind the decimal based on the formula MOD(F2,0.01)=0.
This to make a Euro/dfl denomination look like 0.10 and 0.15, while the real old values (e.g. 12.5 cents) display as 0.125

For those values which on have 2 digits after de decimal, the background color doesn't display..
If I look at the conditions the first one is the one just added (Range A2:AMJ3500; Formula ISNUMBER($H2). This is followed by a hugh list in the style F4 — MOD(F4,0.01)=0
F20-F21 — MOD(F20,0.01)=0
Apparently the list breaks if rows are added... I changed the condition to MOD($F2,0.01=0) for the range F2-F3500.

It seems that changing the number format conditionally overrides the set background color.

Result:
If Fx has the value n.nnn it has de correct background but the numberformat displayed is now n.nn
If Fx has the value n.nn the background is gone

Am I missing something here?
Is this expected behavior?

Thanks,
Rob.

OK, in stead of an dynamic setting I reverted to manual setting (makes the sheet faster too).

I set autofilter on the column, selected all rows not empty, and set the background color...
Simple and fast.

Why do something dynamic if the data is not that dynamic.

Hi :slight_smile:
The dynamic methods are more scalable (or just extend a little) and easier
to replicate. Also the original question looked like it required a less
static approach. With the static approach you need to remember to do 2
actions and try to remember what the reason/rule was for the different
back-grounds. Each approach has pros/cons.

Anyway, congrats on solving the problem in the way that suits your own
use-case the best :))
Regards from
Tom :slight_smile: