Bug 52410 - Conditional Formatting of rows does not work if cell contains formula
Summary: Conditional Formatting of rows does not work if cell contains formula
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.5.3 release
Hardware: All macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-23 20:34 UTC by jean-paul.hahn
Modified: 2012-09-21 14:37 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample file made with LibO 3.5.5.3, following original description, bug NOT visible (7.70 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-08-01 14:10 UTC, Roman Eisele
Details
My spreadsheet for which the formating problem still exists (238.60 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-08-01 19:10 UTC, jean-paul.hahn
Details
Screenshot of ZKB Kapitalgewinn, LibO 3.5.5.3 MacOS X (150.94 KB, image/png)
2012-08-04 07:52 UTC, Roman Eisele
Details
Calc file showing the behavior (239.54 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-08-04 09:22 UTC, jean-paul.hahn
Details
File without garbage in conditional formatting. (229.49 KB, application/x-vnd.oasis.opendocument.spreadsheet)
2012-08-25 23:55 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jean-paul.hahn 2012-07-23 20:34:45 UTC
To reproduce:

1. Create a new spreadsheet.
2. Select a certain range and the select Format, Conditional Formatting ...
3. Enter as first condition: ISEVEN(ROW()) and select a yellow background
4. Enter as second condition:ISODD(ROW()) and select a green background

Up to now everything looks fine and you've got rows colored alternately in yellow and green.

5. Now enter a formula in any on of the colored cells, e.g. =IF(ISBLANK(C9);"";MIN(Kurs))
6. the corresponding cell looses it's color; the conditional formatting doesn't work any more
7. Delete the formula. Now the colur reappears.

Please fix this bug because else I (and all others) have to color cells containing formulas manually.
Comment 1 Roman Eisele 2012-08-01 14:10:07 UTC
Created attachment 65035 [details]
Sample file made with LibO 3.5.5.3, following original description, bug NOT visible

Hello Jean-Paul Hahn,

thank you very much for your bug report, and especially for the detailed steps to reproduce!

However, I can not reproduce the bug for now. I have followed your instructions with LibO 3.5.5.3 and LibO 3.6.0.4, and in both cases for me the result is as expected: the cell containing the formula still has the correct background color.

Therefore we need your help to track down the issue.

Attached to this bug report you will find my sample file made following your steps. Can you please try to point out any differences to your original file(s) which could explain why I get different results? The formula is in cell B4. Maybe I have misunderstood your description at some point. Or there is another important difference; e.g., I don’t know what the "Kurs" in your formula =IF(ISBLANK(C9);"";MIN(Kurs)) means. Maybe it is necessary that there is somewhere a field/cell/... called "Kurs"? (There is no one in my sample file, of course!)

And/or: could you please attach a simple sample file showing the bug?

Thank you very much!
Comment 2 jean-paul.hahn 2012-08-01 19:10:13 UTC
Created attachment 65046 [details]
My spreadsheet for which the formating problem still exists
Comment 3 jean-paul.hahn 2012-08-01 19:12:53 UTC
I attached an example of one of my files for which the error still persists.

Maybe it is due to the fact that "Kurs" is defined as a name for a column range that is used in another column?

Best regards

Jean-Paul Hahn
Comment 4 Roman Eisele 2012-08-04 07:52:52 UTC
Created attachment 65110 [details]
Screenshot of ZKB Kapitalgewinn, LibO 3.5.5.3 MacOS X

(In reply to comment #3)
> I attached an example of one of my files for which the error still persists.

Thank you very much for the sample file!

Just to make sure that we are speeking about exactly the same issue:
When I open your sample file, I see (cf. my attached screenshot) only one cell with wrong background color (cell B11). However, this cell does not contain a formula (like in your original description), but just a plain numeric value (1615). Do you mean this cell, or are there other cells in this sample file with a background color you regard as wrong?
Comment 5 jean-paul.hahn 2012-08-04 09:20:34 UTC
Hi Roman

All cells which do not have a formula are affected (A, B, C). As soon as I enter a date in column A the formatting for that cell is lost. The same happens if I enter values into columns B and C. As soon as I have entered a value unto a cell in column C, the calculation for columns D to J is done and for these cells the formatting remains correct.

You should be able to reproduce this with the attached Calc file.

Best regards
Comment 6 jean-paul.hahn 2012-08-04 09:22:00 UTC
Created attachment 65112 [details]
Calc file showing the behavior
Comment 7 Roman Eisele 2012-08-04 19:52:41 UTC
REPRODUCIBLE with the reporter's sample file (attachment 65112 [details]) and
* LibreOffice 3.5.5.3 (Build ID: 7122e39-92ed229-498d286-15e43b4-d70da21) and
* LibreOffice 3.6.0.4 (Build ID: 932b512),
both with German langpack installed and both on MacOS X 10.6.8 (Intel).

(In reply to comment #5)
> All cells which do not have a formula are affected (A, B, C). As soon as I
> enter a date in column A the formatting for that cell is lost. The same happens
> if I enter values into columns B and C. As soon as I have entered a value unto
> a cell in column C, the calculation for columns D to J is done and for these
> cells the formatting remains correct.

I can confirm this.

If I open the sample file, everything looks correct -- even data rows (4, 6, etc.) have a white background, and odd (5, 7, etc.) data rows have a grey background. But as soon as I try to add another row by entering a date into column A or currency numbers in column B or C, the cell gets a white background, regardless of the current row. This does not even change if I save, close, and open again the file: the cells still have a white background. However,
-- the background of the cells with formulas (column D to J)
   calculated automatically is correct, even in new rows;
-- if I try to change the contents of any cell from A4 to C13,
   which already contain the correct background color,
   the background color remains correct.
Comment 8 m_a_riosv 2012-08-25 23:55:45 UTC
Created attachment 66122 [details]
File without garbage in conditional formatting.

See your file after cleaning the garbage in Menu/Conditional formatting/Manage
I think this was the source of the troubles.

See you must set the condition set to Formula is. Otherwise is against the cell value.
Comment 9 jean-paul.hahn 2012-08-27 20:54:05 UTC
(In reply to comment #8)
> Created attachment 66122 [details]
> File without garbage in conditional formatting.
> 
> See your file after cleaning the garbage in Menu/Conditional formatting/Manage
> I think this was the source of the troubles.
> 
> See you must set the condition set to Formula is. Otherwise is against the cell
> value.


Hi

Thank you very much for your comment. This helped and solved the problem, although I had to fight a little bit with the conditional formating which - to my humble opinion - is quite cumbersome and not as intuitive as in MS-Excel :-(

I have another question regarding styles.

How can I make a user-defined style (e.g. blue-gray background called blue_gray) available in other calc files? I had to re-define the style for each file which is somehow tedious. Is there an easier way?

Best Regards
Jean-Paul Hahn
Comment 10 m_a_riosv 2012-08-28 22:39:20 UTC
> How can I make a user-defined style (e.g. blue-gray background called
> blue_gray) available in other calc files? I had to re-define the style for each
> file which is somehow tedious. Is there an easier way?

You can find in this link: http://www.google.es/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCMQFjAA&url=http%3A%2F%2Fwiki.documentfoundation.org%2Fimages%2Ff%2Ff4%2F0304CG3-StylesAndTemplates.pdf&ei=YUc9UPe4Hq-a0QWxuoCoCQ&usg=AFQjCNHH9U8FSIPsCD8xMofGg1qaqH8OcA&sig2=HCHtyTIXijxgmjPwtgd7LQ

or search in Google for: Libreoffice copy style calc.
Comment 11 Markus Mohrhard 2012-09-20 22:13:45 UTC
Is here still a bug?

If there is it would be nice to shrink the test document to a minimal test document and if not please close the bug report.
Comment 12 Roman Eisele 2012-09-21 12:20:55 UTC
(In reply to comment #11)
> Is here still a bug?

I have to confess that I don’t understand comment #8 and comment #9 completely, so I don’t know what is the state of affairs.


@ Jean-Paul,
@ mariosv:
Can you please explain what is the state of affairs, i.e., is here still a bug?
If not, please set the Status of this bug report to RESOLVED/NOTABUG, etc.

Thank you very much!
Comment 13 jean-paul.hahn 2012-09-21 14:14:35 UTC
Comment 8 contains the solution and Comment 9 contains an additional question from my side. 

In my opinion the case can be closed.

Jean-Paul Hahn
Comment 14 Roman Eisele 2012-09-21 14:37:09 UTC
@Jean-Paul Hahn:
Thank you for your answer and for updating the bug report!

(Just changed Status: RESOLVED/NOTABUG seems more appropriate.)