[CALC] Inconsistency in copying cells with conditional formatting

Suppose that you have a spreadsheet with cells A2:C3 containing some numbers and a conditional format defined on that range. Next do one the following in order:
a) Select the range. Using the black box in the lower-right of C3, expand the range down one row. The data and conditional formatting will both be expanded.
b) Select the entire expanded range (or any two of the rows). Copy and paste it immediately underneath. A new conditional formatting rule is created for the copied cells.
c) Select only the last row. Copy and paste to a new row. Now three separate rules are created, one for each cell.
(I have also had a situation where copying and pasting created thousands of identical rules on the same range, but I am not able to reproduce that.)
I can see where it might be desirable to distinguish between stretching and copying (though personally I’d prefer if it didn’t), but not why it would make a difference whether I was copying one row or multiple rows. Is this something where we should request consistency, and if so, in what way?

(Slghtly edited by @Lupp for better readability.)

b) Select the entire expanded range (or any two of the rows). Copy and paste it immediately underneath. A new conditional formatting rule is created for the copied cells.

Not the case in my version (LibreOffice 7.1.1.2) - Cell Range for the existing rule gets adapted (e.g. copying A2:C3 to A4:C5 results in Range of the rule to be A2:C5.


> c) Select only the last row. Copy and paste to a new row. Now three separate rules are created, one for each cell.

Not the case on my version (LibreOffice 7.1.1.2) - Cell Range for the existing rule gets adapted, if copying directly after the row for which a conditional format already does exist. If copying to another row, an new range specification is being added; eg. copying A10:C10 to A14:C14Range” of the existing rule gets that added A2:C10;A14:C14, but there is no new rule.


Again it seems to prove that it is important to mention LibreOffice version **and** operating system information

You are absolutely right that I should have noted my version and OS. I originally tested on Version: 6.4.5.2 (x64) on Windows 10 Home 19041.867. After seeing your comments, I retested on a development build of 7.2 and to my surprise it behaved identically to the way I originally reported.
I also installed 7.1.1.2 on a different device and retested there. I was again able to reproduce the behavior I originally described.
Perhaps someone else will test and report their results.

Is that you having reported tdf#141068 [EDITING] Undo can fragment conditional formatting ?

Until now I have tested 7.1.1.2 (Linux, Windows), 6.4.5.2 (Windows), 6.3.6.2 (Linux) and did not succeed to verify your problem description. In all my attempts the range has been adapted as expected.

My gut starts telling me, that the issue might be related to the condition (I’m using a simple “*Cell value is equal to” condition), you are using. Hence it might be helpful, if you’d upload a sample file containing your condition.


Please do **not** use *Add Answer* but **[edit](https://ask.libreoffice.org/t/calc-inconsistency-in-copying-cells-with-conditional-formatting/62708)** your original question to enhance the details of your question and/or to upload sample file(s) (answers are reserved for solutions to a problem on this Q&A site). Thanks in advance …

Your gut is right. When I use the “Cell value is equal to” condition, it works as you describe.
Yes, that was me on 141068. And on further testing, I see that when I use “Cell value is equal,” the problem does not occur.
So… where do we go from here? I think that what I should do is put an answer on this question indicating that the issues occur only with certain types of conditional formatting and also update the bug report to reflect that. I will also try out some of the other types and see how those work.

The very first thing I’d suggest to do: Update bug report tdf#141068 with a precise “Steps to Reproduce:” description, esp. regarding “2. Create a conditional formatting (CF) rule on that data”.

Can I edit the description, or can I only add a comment with the clarification?

If you are asking about bugzilla functionality: You can only add new comments. Once saved, you cannot change a comment any more.