The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.13



How to apply

Conditional Formatting to a Cell

Provided from
the Documentation Project

Table of Contents

1. Introduction: an example

You are a bookseller and sell books every day. You'd like to highlight, in color, the number of books sold during a week with the result displayed in yellow if less than 100 and in blue if 100 or more were sold.

To do so, you have to create 2 new styles for each color and 2 formatting conditions: one for numbers less than 100 and another for those numbers greater than or equal to 100.

Let's do it!

2. Create a new Style

To create a new Style, open the Stylist:

In the Stylist window, there are several styles ready to use. You'll use the Default style as a base to create your own:

conditional formatting window
The dialog window that will appear has several tabs as in the diagram below:

In the Stylist, your new style will be displayed with the name you gave it. Repeat the steps above to create the style 'yellow'.

Note: You have created a background style, but of course you may apply other features to that style. By clicking on the other tabs, you may access many other functions, such as, apply a border, change font, alignment, etc.

3. Apply the Conditional Formatting

You have typed your figures, inserted your formulas in the cells, and now you wish to add some colors!

In our example, the colors are to be displayed in cell [B9]

  1. Select the cell [B9]
  2. in the Format menu, choose Conditional Formatting
  3. In the window that will appear, you'll insert your condition:

  4. under Condition 1, click the small triangle of the first drop-down menu and choose 'Cell value is'
  5. Then, in the second drop-down menu, choose 'greater than'
  6. in the next box to the right, insert the value, 99. Eventually, you can change the selected cell by clicking on the Shrink icon shrink icon
  7. In the drop-down menu labeled, Cell Style, search and select the 'Blue' style,
  8. Check the Condition 2 check-box, repeat steps from 4 up to 7, but use 'less than', a value of '100', and 'yellow' style where applicable,
  9. Click on OK,

Look at the result: type in '122' in cell [B9] and the color changes!






4. Credits

Author: Sophie Gautier

Thanks to: Richard Holt, great proof reader and OOo contributor

Intgr by: Gianluca Turconi

Last modified: January 28, 2002

Contacts: Documentation Project

Translation: Gianluca Turconi


Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.