Text Documents (Writer)
HTML Documents (Writer Web)
Spreadsheets (Calc)
Presentations (Impress)
Drawings (Draw)
Database Functionality (Base)
Formulae (Math)
Charts and Diagrams
Macros and Scripting
Office Installation
Common Help Topics
OneOffice Logo

Conditional Formatting

Use Conditional Formatting to define range-based conditions that determine which cell style will be applied to each cell in a given range based on its contents. The cell style corresponding to the first condition that evaluates to true is applied. Cell styles applied through Conditional Formatting override cell styles applied manually using the Formatting Bar or the Styles sidebar.

To access this command...

Choose Format - Conditional.

You can enter several conditions that query the cell values or results of formulas. The conditions are evaluated from first to the last. If Condition 1 is true based on the current cell contents, the corresponding cell style is applied. Otherwise, Condition 2 is evaluated to determine if its corresponding style will be applied. If none of the conditions match cell contents, then no changes are made to the cell format.

Conditional formats do no overwrite cell styles and direct formatting applied manually. They remain saved as cell properties and are applied when the cell matches no conditions or when you remove all conditional formats.

To apply conditional formatting, AutoCalculate must be enabled. Choose Data - Calculate - AutoCalculate (you see a check mark next to the command when AutoCalculate is enabled).

Condition list

List of the conditions defined for the cell range in order of evaluation. You can define as many conditions as you want.

Up

Increase priority of the selected condition.

Down

Decrease priority of the selected condition.

Condition list entry

Specify if conditional formatting is dependent on one of the entry listed on the drop down box:

  • If you select All cells, see Colour Scale, Data Bar or Icon Set explanations below, depending on which visual representation the conditional formatting should be represented.
  • If you select Cell value is:
    • Select a condition in the drop down list for the format to be applied to the selected cells and enter the value.
    • In front of Apply Styles, select the desired style in the list or chose New Style to create one.
    • Click the Add button to add another condition, click the Remove button to remove a condition.
    • In the Range field, define the range of cells concerned by the conditional formatting. Click on the Shrink button to minimise the dialogue box. Click again on the button to come back to the dialogue box once the range is selected.
  • If you select Formula is as a reference, enter a cell reference. If the cell reference is a value other than zero, the condition matches.
  • If you select Date is, see below explanations for Date.

Colour Scale

This is the same dialogue box as if you select All cells in the first sub menu entry Condition. Apply a colour scale to a range consist of displaying a bicolour or tricolour gradient on this range depending on the value of each cell. A typical example might be an array of temperatures, lower blue coloured, warmer red with a gradient nuances to the intermediate values.

You must choose the two "extreme" colours indicate the method of calculation. The calculation of the colour applied will be made in relation to: Min - Max - Percentile - Value - Percent - Formula.

The choices Min and Max are sufficient to themselves as found in the range. Other options need to be specified by a value (Percentile, Value, Percentage) or a cell reference or formula (Formula).

For a detailed explanation and examples, please visit How to apply a Colour Scale Conditional Formatting page in TDF Wiki.

Data Bar

Data bar option will fill the cell with solid or gradient colour corresponding to the numeric value in the cell. Default is blue for positive and red for negative.

The calculation of the area of fill is based on Min - Max - Percentile - Value - Percent - Formula.

The choices Min and Max are sufficient to themselves as found in the range. Other options need to be specified by a value (Percentile, Value, Percentage) or a cell reference or formula (Formula).

More Options... opens a dialogue box to:

  • change colours
  • change position of vertical axis within the cell
  • the bar's minimum and maximum length in percentage

Icon Set

It is desired to plot the position of a value relative to the thresholds. The set of icons will help to indicate the thresholds and choose the type of icons. Available icon sets are:

  • 3, 4 or 5 - arrows
  • 3, 4 or 5 - grey arrows
  • 3 - flags
  • 3 - traffic lights 1 and 2 (two different designs)
  • 3 - symbols (square, triangle, circle)
  • 4 - circles from red to black
  • 4 or 5 - ratings
  • 5 - quarters

Conditions to display each icon can be specified relative to a value (Value), a percentage of the number of values in the range (Percentage) as a percentage of range values (Percentile) or formula (Formula).

For a detailed explanation and examples, please visit How to use Icon Set Conditional Formatting page in TDF Wiki.

Dates

This option will apply a defined style depending on a date that you choose in the drop down box: Today - Yesterday - Tomorrow - Last 7 days - This week - Last week.

  • In front of Apply Styles, select the desired style in the list or choose New Style to create one.
  • Click the Add button to add another condition, click the Remove button to remove a condition.
  • In the Range field, define the range of cells concerned by the conditional formatting. Click on the Shrink button to minimise the dialogue box. Click again on the button to come back to the dialogue box once the range is selected.

Manage Conditional Formatting

This dialogue box allows you to see all the conditional formatting defined in the spreadsheet.

To access this command...

Choose Format - Conditional Formatting - Manage.

The Manage Conditional Formatting dialog box opens. Here you can add, edit or remove one or several conditional formattings.

The Conditional Formats list displays the active conditional formatting rules set in the current spreadsheet. Only the first rule for each cell range is listed, even if there are multiple rules defined for a given range.

If you have defined a conditional formatting on a cell range and you try now to define a new conditional formatting on a part of this range, a warning message will be displayed, asking if you want to edit the existing conditional formatting (on the whole range) or define a new conditional formatting overlapping it (on the selected range).