Dynamic Cell Background Color

Hi, is it possible to have the cell color change from say red through the variations to blue according to how close a value is to a min. or max. value?

So value is 50, min is 0 max is 100. Cell color would be 50% red and 50% blue.

I guess you don’t want a simple conditional formating with options only equal, smaller, greater… but a proportionnal relation between colors and figures.
I think only a special macro would do, in that case.

In Lo3.6 and LO4.0 you can achieve this now very easy with Conditional Formating:

Select te range to format. Menue Format->Conditinal Formatting >Conditinal Formatting. In the wndow click Add, some prefilled drop-down boxes appear:

Select Top left: “All Cells” Center “Color Scale (2 Entries)”,

Middle left: “Min”, Right “Max”,

Colors Red for Min and Blue for Max are predefined. You can play with the colors and settings.

Unfortunately there is so far no help available.

The problem to get it with conditional formatting is that you need to define one style for every color you need.

One trick is to use the STYLE function in the conditional formatting.

Select formula.
and use a formula like:
STYLE(“Variation_”&FormulaForVariation)

If you have defined the styles:
Variation_10
Variation_20
Variation_30
and the result of FormulaForVariation is 10 or 20 or 30,
then you get the proper style applied.

Hi @micnolmad,

A similar feature is available in LO 3.6+:

Are you looking for some kind of gradient between the two colors? That might require a macro or even additional development in the LO codebase…