Bug 137062 - VIEWING Cells with conditional formatting by formula with INDIRECT function not automatically updated after change of source value
Summary: VIEWING Cells with conditional formatting by formula with INDIRECT function n...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Conditional-Formatting
  Show dependency treegraph
 
Reported: 2020-09-26 20:32 UTC by Stefan_Lange_KA@T-Online.de
Modified: 2022-12-27 18:49 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
zip file with document to show the problem and screenshots (638.25 KB, application/x-zip-compressed)
2020-09-26 20:32 UTC, Stefan_Lange_KA@T-Online.de
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan_Lange_KA@T-Online.de 2020-09-26 20:32:59 UTC
Created attachment 165877 [details]
zip file with document to show the problem and screenshots

Conditional formatting by formula is (occasionally?) not applied correctly, means not immediately after a change of source value, but later e.g. when the document is saved.
Steps to reproduce the bug: 
- open "Test_Formula_(Blood_pressure).ods" from the attached zip file
Values in columns A and B (Date and time) have a conditional formatting by formula that the font and background color are changed to green resp. lightgreen when at least one of the values in columns F, J and N is less than 100. Values in these 3 columns are computed by formula depending on values in columns C+D, G+H resp. K+L.
- change value in cell L10 from 86 to 90 -> value in cell N10 automatically changes from 99 to 102
- result: cells A10 and B10 remain unchanged although the condition for conditional formatting is false, see screenshots 1 and 2
- save the document (or edit cell A10 or B10 e.g. by PF2 + exit without changes e.g. by Enter key), see screenshot 3
- result: font and background colors of cells A10 and B10 are changed now correctly (Standard, no background color)

First I have assumed the behavior described above is related to the behavior described in Bug 137060. But it can be reproduced also with older versions of LibreOffice back until 3.3.0, means the bug is inherited from OpenOffice.
Comment 1 m_a_riosv 2020-09-26 23:57:37 UTC
I think the issue has to-do with the use of INDIRECT in the CF formula.
I remember @Markus complaining about the use of STYLE, also a volatile function inside CF.
Volatile functions are calculated after every cell's change on the spreadsheet.
Using Menu/Data/Calculate/Calculate hard, solve the issue

But the better for this is change the formula:
OR( AND((INDEX($F:$F;ROW()) > 0);(INDEX($F:$F;ROW()) < 100));AND((INDEX($J:$J;ROW()) > 0);(INDEX($J:$J;ROW()) < 100));AND((INDEX($N:$N;ROW()) > 0);(INDEX($N:$N;ROW()) < 100)))
using INDEX instead INDIRECT, it is alsw quicker and less prone to errors because it refers to cells address, not to handwritten addresses.

Any case seems there is a bug.
Comment 2 Stefan_Lange_KA@T-Online.de 2020-09-27 04:54:02 UTC
Many thanks for the hint to replace INDIRECT by INDEX! This solves my problem.

I have a lot of documents with formulas containing INDIRECT. I will adapt them now step by step.
I never was happy with the use of INDIRECT. Because of the handwritten adresses the formulas are hard to maintain in the case of neccessary changes and - as said in the hint - prone to errors.
Comment 3 QA Administrators 2022-12-27 03:18:11 UTC Comment hidden (obsolete)
Comment 4 Stefan_Lange_KA@T-Online.de 2022-12-27 18:49:06 UTC
I have tested with
Version: 7.5.0.1 (X86_64) / LibreOffice Community
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL threaded

Result: The bug is still present.

For me the bug is no longer important after I have replaced INDERECT by INDEX in all my formulas.