Ask Your Question
0

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

asked 2012-11-19 20:46:01 +0200

Adobe gravatar image

updated 2013-02-07 21:10:28 +0200

manj_k gravatar image

I tried:

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

but it gives 0 ???

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-10-19 00:45:48.117493

Comments

One has to have a style called "Red" and "Green".

Adobe gravatar imageAdobe ( 2012-12-04 13:27:55 +0200 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2012-11-19 21:39:15 +0200

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-11-19 20:46:01 +0200

Seen: 2,331 times

Last updated: Nov 19 '12