OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Highlight cell value

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
lord.hong
Newbie
Newbie


Joined: 30 Jul 2006
Posts: 3

PostPosted: Sat Aug 05, 2006 7:01 am    Post subject: Highlight cell value Reply with quote

Hi,

I was thinking that this job would be really easy but after three day I came to the conclusion that I can not solve this problem.

The task is easy. If one row greater than the corresponding row then a third row should change the color to red.

The pseudo code is looking:

if (A1 > B1) then
font color of C1 get red
else
font color of C1 stay black
endif

I did not find a solution with formula, conditional foramtting, or stylist.

Has anybody an advice?

Thanks,
Markus
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Sat Aug 05, 2006 8:36 am    Post subject: Reply with quote

if (A1 > B1) then
font color of C1 get red
else
font color of C1 stay black
endif
If C1 already has a formula returning a number:
=<existing formula>+IF(A1>B1;STYLE("myRedStyle"))
If C1 already has a formula returning a string:
=<existing formula>+IF(A1>B1;T(STYLE("myRedStyle")))
If C1 is supposed to be a formula or a constant.
Select C1:Cxxx
Notice which cell is the active cell (the bordered one getting next input)
Menu:Format>Conditional
Change "Value" to "Formula"
Formula: $A1>$B1 (replace 1 with the row of active cell)
Style: "myRedStyle"
In any case you need to define some style. The examples suggest a style named "myRedStyle".
_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
Back to top
View user's profile Send private message
DiGro
Super User
Super User


Joined: 02 Jun 2004
Posts: 1208
Location: Hoorn NH, The Netherlands

PostPosted: Sat Aug 05, 2006 8:59 am    Post subject: Reply with quote

Well,

it is quiet obvious I think.

What do you want to display in C1 ?? If there is nothing written you can't color it.

Your formula: IF(A1>b1) might be true, but then what ??

So you have to make an addition like : IF(A1>B1;"YES";"")

in that case you have something in C1 to color red, otherwise you will have nothing to color.

Now you can use Conditional format to color C1 red if there is YES in it
Assign a new made cell-style with the fontcolor red to the cell if the formula results to YES.

EDITED: Typing while VILLEROY was sending.
_________________
DiGro

Windows 7 Home Premium and OOo 3.3 NL (Dutch)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group