Bug 116145 - Inserting columns using selected (grouped) sheets causes calculation error.
Summary: Inserting columns using selected (grouped) sheets causes calculation error.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected) release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Cell-Formula
  Show dependency treegraph
Reported: 2018-03-02 17:20 UTC by julian.morris
Modified: 2018-03-05 00:32 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

Six sheet spreadsheet to use to reproduce problem (15.00 KB, application/vnd.ms-excel)
2018-03-02 17:23 UTC, julian.morris

Note You need to log in before you can comment on or make changes to this bug.
Description julian.morris 2018-03-02 17:20:28 UTC
Example when using a LibreOffice Calc spreadsheet containing 6 sheets. 
Sheets 2, 4, & 6 have data in columns C, E, G & I which are added together in column K using =C2+E2+G2+I2
Then select (group) sheets 6, 4, & 2 (using Ctrl+ clicking on relevant sheet) and use “Insert Column Left” before column E on sheet 6

The additional column is correctly added to sheets 6, 4 & 2 but the calculation in column L (the original column K) on sheets 6 & 4 is incorrect e.g. =D2+F2+H2+J2 – it should be =C2+F2+H2+J2
On sheet 2 the calculation is also incorrect e.g. =A2+F2+H2+J2 - it should be =C2+F2+H2+J2

Then select “Undo”. 
Column K on sheets 6 & 4 shows the correct value but the calculation is incorrect e.g. =D2+E2+G2+I2 - it should be =C2+E2+G2+I2
The calculation on sheet 2, column K is correct, e.g. =C2+E2+G2+I2 but extra calculations have been incorrectly added to columns L & M

Saving and re-opening the file, recalculates sheets 6 & 4 column K and now also shows the wrong value. Sheet 2 still has the calculations incorrectly added to columns L & M

A similar problem occurs if using “Insert Column Right”.

The attached spreadsheet was used to highlight this error.

Steps to Reproduce:
1.See Description for steps to Reproduce

Actual Results:  
See Description

Expected Results:
See Description

Reproducible: Always

User Profile Reset: Yes

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-GB
Module: StartModule
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no

User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
Comment 1 julian.morris 2018-03-02 17:23:58 UTC
Created attachment 140294 [details]
Six sheet spreadsheet to use to reproduce problem
Comment 2 m.a.riosv 2018-03-03 14:57:41 UTC
Version: (x64)
Build ID: f7f06a8f319e4b62f9bc5095aa112a65d2f3ac89
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: es-ES (es_ES); Calc: group