Bug 143816 - Bug? Dragging formulae drags value as well
Summary: Bug? Dragging formulae drags value as well
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: Cell-Formula
  Show dependency treegraph
 
Reported: 2021-08-10 20:48 UTC by robert
Modified: 2024-03-27 05:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Spreadsheet displaying the bug (1.26 MB, application/vnd.oasis.opendocument.spreadsheet)
2021-08-10 20:51 UTC, robert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robert 2021-08-10 20:48:43 UTC
Description:
When dragging a cell to other cells (empty or not makes no difference) to copy a formula, it seems that not just the formula is dragged, but also the value of the cell that is dragged, and no amount of recalculating will change this value. Only overtyping the actual formula, or one character of it will correct this situation!

NOT THAT THIS IS A VERY SEVERE BUG!

Steps to Reproduce:
1. Open the attached spreadsheet, and select the Naco-CoTy-Naty sheet

2. Note the values in these cells and their formulae:

- G2: 48 / =MAX(G2:G301)
- H2: 19 / =MAX(H2:H301)
- I2: 24 / =MAX(I2:I301)
- J2: 93 / =MAX(J2:J301)

2. Select cell cell G2, and drag it across to cells H2, I2, and J2

3. Note the new values / formulae in these four cells:

- G2: 48 / =MAX(G2:G301)
- H2: 48 / =MAX(H2:H301)
- I2: 48 / =MAX(I2:I301)
- J2: 93 / =MAX(J2:J301)

4: Press F9 until you're blue in the face, and nothing will change the values of cells H2 & I2

5: Edit cells H2 & I2, by just deleting the closing parentheses of the formulae, and hey, now the values are recalculated correctly!

Similar thin happens fro draggingR2 across S2/T2/U2, here only S2 is screwed up!

Actual Results:
See above

Expected Results:
Se above


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.5.2 (x64) / LibreOffice Community
Build ID: 85f04e9f809797b8199d13c421bd8a2b025d52b5
CPU threads: 8; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-US
Calc: threaded

Note: I have not tried to reduce the sheet to something minimal, it happens in this one!
Comment 1 robert 2021-08-10 20:51:38 UTC
Created attachment 174195 [details]
Spreadsheet displaying the bug
Comment 2 robert 2021-08-10 20:55:29 UTC
NOTE THAT THIS IS A VERY SEVERE BUG!
Comment 3 Dmitrii A 2021-08-11 03:20:18 UTC
no repro in

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: ac80ec817eb07c77a51bc0729985a473c734182e
CPU threads: 16; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

Hello, this is just formula mistake, for examle G2 "=MAX(G2:G301)" should be "=MAX(G3:G301)". Try to edit and copy this formula to H2, I2, J2 cells.
Comment 4 robert 2021-08-11 07:50:29 UTC
Yes, and no. The formula is indeed wrong, but when I'm dragging cell contents, I would expect only the formula to be dragged, not the result of the formula.
Comment 5 [REDACTED] 2021-08-11 17:41:20 UTC
(In reply to robert from comment #4)
> Yes, and no. The formula is indeed wrong, but when I'm dragging cell
> contents, I would expect only the formula to be dragged, not the result of
> the formula.

What you are doing here is a performance killer, since your circular references cause iterations as per settings in Tools -> Options -> LibreOffice Calc -> Calculate -> Iterations. Disable "[ ]Iterations" and you get what it is - "Err:522 ; Circular reference" - see also: https://help.libreoffice.org/latest/en-US/text/scalc/05/02140000.html
Comment 6 robert 2021-08-11 18:27:27 UTC
Sadly, this file requires circular references on another sheet, I would obviously have seen that they were there if this had not been the case. 

However, and that's my point, when dragging the contents of cells to other cells, only the underlying formula should be dragged (and changed), NOT the result of the formula!
Comment 7 AndreasHengst 2022-03-15 23:29:36 UTC
I'm not convinced it's a bug, but inconsistent behavior is revealed. Too tricky for me to decide.

A better title is "Bug?? Dragging formulae drags value as well"
Either this is 1) a bug  or 2) it's expected/necessary behavior.

At first I thought that bringing the original cell value along might be an optimization, but a recalculation always needs to be done, so why copy the value? Perhaps in case recalculation is disabled? (found no such disabling setting in Calc)(just recalc the copied cell instead of all)

I was able to reproduce PROVIDED I first enable [x]Iterations in
WINDOWS: Tools > Options > LibreOffice Calc > Calculate > Iterative References.
MAC: LibreOffice > Preferences > LibreOffice Calc > Calculate > 

I was able to reproduce behavior using a very simple sheet. Drag A1 to the right.
    A  B  C
1  30 20  1     // Formulas   =max(A1:A3)  =max(B1:B3)  =max(C1:C3)
2  30 20  1     // just numbers
3  30 20  1     // just numbers


Version: 7.3.0.3 (x64) / LibreOffice Community
Build ID: 0f246aa12d0eee4a0f7adcefbf7c878fc2238db3
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Also on MacOS ver 7.1.0.3, and 5.3.2.2 so Changed "Hardware" designation from x86+windows to All+All.

In the original post Step 4: "Press F9..." the formulas in H2 and I2 are evaluating correctly because 48 IS the max of 48 and some smaller values.
In the original post Step 5: ... *that* might be a bug. 'Type into here' is possibly inconsistent with 'drag into here' result.
Comment 8 AndreasHengst 2022-03-16 00:00:22 UTC
Changing bug title/summary from "Dragging formulae across columns result in persistent wrong data" to "Bug? Dragging formulae drags value as well"
Comment 9 Armondo Lopez 2024-03-26 19:08:19 UTC
Thank you for reporting the bug. I can confirm that the bug is present in 

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

as well as

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a2265e8faa099d9652efd12392c2877c2df1d1eb
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded