Bug 134485 - Formula with Names as Addressing copied from another sheet calculates per original sheet
Summary: Formula with Names as Addressing copied from another sheet calculates per ori...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
6.4.4.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-03 15:08 UTC by TorrAB
Modified: 2020-07-30 18:32 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
file with 2 sheets (9.62 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-07-03 15:11 UTC, TorrAB
Details
screenshot of DefineLabelRange, Sheet2 (24.71 KB, image/png)
2020-07-07 15:23 UTC, TorrAB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TorrAB 2020-07-03 15:08:42 UTC
Description:
Open absp.ods, select cells A1…B5, copy&paste (^c, ^v) them to Sheet2.
	On Sheet2, change the value of bb (cell B2); the values of s and p are not updated! Recalculating (f9, ^F9) does not help.
	Return to Sheet1, change the value of bb; the values of s and p are updated on both sheets! Not expected, since aa and bb are local (sheet-level) variables, as indicated by the quotation marks, eg, in cell B5: ='aa'+'bb'. On the other hand, cell B7 uses variable cc unquoted: =2*cc.
	The user should be able to modify, use (and trust! No 6+5=8) Sheet2 without remembering that it was copied from another sheet.


Steps to Reproduce:
1.Open absp.ods, select cells A1…B5, copy&paste (^c, ^v) them to Sheet2.

2.On Sheet2, change the value of bb (cell B2)
3.

Actual Results:
the values of s (=aa+bb) and p (aa*bb) are not updated.

Expected Results:
all calculations using bb should be updated


Reproducible: Always


User Profile Reset: No



Additional Info:
none
Comment 1 TorrAB 2020-07-03 15:11:05 UTC
Created attachment 162614 [details]
file with 2 sheets
Comment 2 TorrAB 2020-07-03 15:14:35 UTC
This bug is severe; it gives wrong results without any warning.
Comment 3 m_a_riosv 2020-07-06 21:05:07 UTC
I think you need to define the label ranges, so first they are searched in the same sheet.

https://help.libreoffice.org/6.4/en-US/text/scalc/01/04070400.html?&DbPAR=CALC&System=WIN
Comment 4 TorrAB 2020-07-07 15:23:01 UTC
Created attachment 162760 [details]
screenshot of DefineLabelRange, Sheet2
Comment 5 QA Administrators 2020-07-08 03:43:31 UTC Comment hidden (obsolete)
Comment 6 sora34ce 2020-07-27 21:26:26 UTC
I was doing some testing and I figured that labels aren't optimal. Instead of using 'aa', I think one good way is to refer to the cells not by labels, but by the order of the spaces (for instance, B1+B2). That way it could work.
Comment 7 Timur 2020-07-30 18:32:19 UTC
We need to explain exactly how and why ='aa'+'bb' sums B1 and B2.
Those are not defined ranges, but cell contents, unlike cc, which is global name. 
Screenshot attachment 162760 [details] does not correspond to attachment 162614 [details].

Those are Names by Addressing: https://help.libreoffice.org/7.1/en-US/text/scalc/guide/address_auto.html?&DbPAR=WRITER&System=WIN
Also at https://help.libreoffice.org/7.1/en-US/text/shared/optionen/01060500.html?System=WIN&DbPAR=CALC&HID=modules/scalc/ui/optcalculatepage/OptCalculatePage#bm_id3149095

Now we have 2 possibilities:
1. call this a bug, expect LO to keep separate Names per sheet, which complicated this a little, also what if same names are repeated on a sheet;
2. accept that this is helpful but of limited use (Lo is guessing cells) and take case of proper naming with single name for formula use, avoid copying and just update Documentation.

I'll confirm so far as Documentation. In any case, it should be updated so this is clarified. 
Further discussion is welcome.