Calc: make cell red if the value is above given?

I tried:

=STYLE(IF(B3>3,"Red","Green"))

but it gives 0 ???

One has to have a style called “Red” and “Green”.

There are few things to consider.

First, do you have “Red” and “Green” styles defined? If not, you must first define them (read chapter 4 of Calc guide for additional informations).

Second, do you want to change style of reference cell (B3), or another cell?
If you want to change style of B3 cell, then you must use CURRENT() function, that will return calculated value of current cell in time of evaluation.

And remember that STYLE() function always returns zero. You can simply add it to your formula.

So, to make reference cell red if it’s value is above given, use this formula:

=4 + STYLE(IF(CURRENT()>3,"Red","Green"))

For larger dataset you will find that conditional formatting is more convenient. You will find it under “Format” menu. You can read more about conditional formatting in chapter 2 of mentioned Calc Guide.