OpenOffice.org video based manual
Plan-B for OpenOffice.org, learning office productivity software with videos


Tech Support for OpenOffice.org
Applications
Go to Open Office Writer Index
Go to Open Office Impress Index
Go to Open Office Math Index
Go to Open Office Draw Index
Go to Open Office Calc Index
Go to Open Office Base Index
Go to Open Office Online Help Index

Help Sections:
General
Writer
Impress
Math
Draw
Calc
Base
Basic

Assigning Formats by Formula

The STYLE() function can be added to an existing formula in a cell. For example, together with the CURRENT function, you can color a cell depending on its value. The formula =...+STYLE(IF(CURRENT()>3; "Red"; "Green")) applies the cell style "Red" to cells if the value is greater than 3, otherwise the cell style "Green" is applied.

If you would like to apply a formula to all cells in a selected area, you can use the Find & Replace dialog.

  1. Select all the desired cells.

  2. Select the menu command Edit - Find & Replace.

  3. For the Search for term, enter: .*

    ".*" is a regular expression that designates the contents of the current cell.

  4. Enter the following formula in the Replace with field: =&+STYLE(IF(CURRENT()>3;"Red";"Green"))

    The "&" symbol designates the current contents of the Search for field. The line must begin with an equal sign, since it is a formula. It is assumed that the cell styles "Red" and "Green" already exist.

  5. Mark the fields Regular expressions and Current selection only. Click Find All.

    All cells with contents that were included in the selection are now highlighted.

  6. Click Replace all.

Index

formats, assigning by formulas

cell formats, assigning by formulas

STYLE function example

cell styles,assigning by formulas

formulas,assigning cell formats

applying,cell formats

This help text is published from the OpenOffice-Help files under the Public Documentation License 1.0.

Get OpenOffice.org - Free!