Hi Paul,
Itipong (Paul) schrieb:
Dear Sir or Madam
I would like to know if I can change the font color by using IF Function as an
example below.
=if((a1+b1)<5;red(a1+b1);green(a1+b1))
I cannot find a solution or an example on the OpenOffice Help. So please
advise.
Your assistance is much appreciated.
Besides the way Brian has described, I know two other ways. For both you
need to define cell styles. Define a cell style "green", where you
select a green color in tab "Font Effects" or perhaps a green background
or a green border. Do similar for cell style "red".
Method A: conditional formatting
Assign to all result cells the format "green".
Set cursor in result cell and use Format > Conditional Formatting.
Set the condition to "cell value is" "less than", the value to 5, and
the style to "red".
Copy that cell.
Select all other result cells and use Edit > Paste Special. Unselect all
but "Formats". OK
Method B: function STYLE
Use the formula =a1+b1+IF(a1+b1<5;STYLE("red");STYLE("green"))
The function STYLE results 0, so that adding it to a1+b1 will not change
the result. The function STYLE formats the cell in which it is used with
the style given by the style name.
Kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@openoffice.apache.org
For additional commands, e-mail: users-h...@openoffice.apache.org