Bug 103564 - Formulas cling to orignal cells they point to, which will move, in other columns when sorting for first column
Summary: Formulas cling to orignal cells they point to, which will move, in other colu...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.3.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-28 21:54 UTC by jmekdeci
Modified: 2016-10-30 11:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
After the sort by date (19.49 KB, application/pdf)
2016-10-28 21:57 UTC, jmekdeci
Details
Before sorting by date (19.50 KB, application/pdf)
2016-10-28 21:57 UTC, jmekdeci
Details
Spreadsheet Used (27.75 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-10-28 21:58 UTC, jmekdeci
Details
Screenshot of options menu (84.32 KB, image/png)
2016-10-28 23:10 UTC, jmekdeci
Details
Screenshot of Expert Window (118.10 KB, image/png)
2016-10-30 03:47 UTC, jmekdeci
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jmekdeci 2016-10-28 21:54:11 UTC
Description:
Before sorting by date column:
Date	Sales Per Day	Sales Accumulated
10/01/16	 $100.00	$100.00
10/03/16         $100.00	$200.00
10/20/16	 $100.00	$300.00
10/02/16	 $100.00	$400.00

After sorting by date column:
Date	Sales Per Day	Sales Accumulated
10/01/16	$100.00	$100.00
10/02/16 	$100.00	$400.00
10/03/16	$100.00	$200.00
10/20/16 	$100.00	$300.00   <---different total!!!

Obviously we should end at $400 on the bottom right.
The formula (of third column) was only to add the cell above to the cell on the left.
I will attempt to attach the files.

Steps to Reproduce:
1. see description

Actual Results:  
Wrong final total due to sorting by date!  Not obvious to user!

Expected Results:
Accurate final totals preserved in sorting!



Reproducible: Always

User Profile Reset: Adjust the formulas in sorting to point to new cells.
For example the $400-showing cell (C3) after sort should have had new formula C2+B3, but had formula C5+B3

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0
Comment 1 jmekdeci 2016-10-28 21:57:00 UTC
Created attachment 128333 [details]
After the sort by date
Comment 2 jmekdeci 2016-10-28 21:57:40 UTC
Created attachment 128334 [details]
Before sorting by date
Comment 3 jmekdeci 2016-10-28 21:58:14 UTC
Created attachment 128335 [details]
Spreadsheet Used
Comment 4 m_a_riosv 2016-10-28 22:19:32 UTC
There is an option in:

Menu/Tools/Options/LibreOffice calc/General - Update references when sorting range of cells.

that looks you have enable, with it I can reproduce your issue, disable it and sort it's fine.

Resolved as not a bug, please if you are not agree, reopen it.
Comment 5 jmekdeci 2016-10-28 23:09:56 UTC
No I do not see the option you describe in my menu.
I will attach a screenshot.
Comment 6 jmekdeci 2016-10-28 23:10:53 UTC
Created attachment 128337 [details]
Screenshot of options menu
Comment 7 m_a_riosv 2016-10-29 22:35:08 UTC
Please update your version, I remember there was a long discussion when it was enable by default, solution was make available an option for that.

The option is available at least since version 4.4

On your version I think you can change it on:
Menu/Tools/Options/LibreOffice/Advanced - Expert configuration.
Change the key:
/org.openoffice.Office.Calc/Input - UpdateReferenceOnSort
to false.
Comment 8 jmekdeci 2016-10-30 03:47:20 UTC
Created attachment 128350 [details]
Screenshot of Expert Window
Comment 9 jmekdeci 2016-10-30 03:50:25 UTC
Thank you for your helpfulness!

Unfortunately I can't upgrade because I'm using an OS called Tails which (is great but) has this version embedded and is hard to change. But I'll try to ask them to upgrade.

As for finding your option in the list, I didn't see it in my Expert menu (attached).

But you don't owe me support.  So since you've already fixed it in a later version, please feel free to change status to RESOLVED.
Comment 10 m_a_riosv 2016-10-30 11:52:42 UTC
Ok, last you can try it's edit directly that key on the registrymodifications.xcu file, what you can find on the profile. 
https://wiki.documentfoundation.org/UserProfile#Location_based_on_Tools.C2.A0.E2.96.B8_Options.C2.A0.E2.96.B8_LibreOffice.C2.A0.E2.96.B8_Paths