spreadsheetconditional-formattinglibreofficelibreoffice-calc

Conditional Formatting based on value in preceeding column [LibreOffice Calc]


I want to track whether a value is increasing or decreasing over time using cell formatting.

If the value has increased, i.e. if it is a higher value than in the column directly right, then I would like one colour to be applied. If the opposite is true, then another colour should be applied.

I tried simply using an 'if A1>B1' 'then colour Light Blue' formula, but it doesn't work.

As you can see from the below image, the change in colour does not accurately reflect whether the price has gone up or down.

enter image description here


Solution

  • I don't know of any place where this is documented, indeed I am not even sure how to phrase it, anyway: when you select a range of cells for conditional formatting, any cells with relative coordinates that you then mention in the formula will be associated (will be in lockstep) with the top-left cell of the range, i.e. the actual formula applied to any specific cell in the range will use shifted coordinates for the cells mentioned in the formula according to the position of the cell to be formatted relative to the top-left cell in the range.

    In practice, to make your conditional formatting work, just specify the formula B5 > C5, where B5 is the top-left-most cell in that range.