Bug 97558 - : sort function doesn't maintain coherency of formula in a cell
Summary: : sort function doesn't maintain coherency of formula in a cell
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.0.4.2 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-04 10:47 UTC by nguyen
Modified: 2016-02-10 19:02 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
spreadsheet to calculate a balance between ressource (credit) and expense (debit) (16.09 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-02-04 10:47 UTC, nguyen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nguyen 2016-02-04 10:47:43 UTC
Created attachment 122374 [details]
spreadsheet to calculate a balance between ressource (credit) and expense (debit)

Hi,

I use libreoffice after downloading Libreoffice_5.0.4_win_x86.msi. 

In the spreadsheet which is attached, we retain the cell G51 with the formula F49-G50. the result is 36. Select all the table (except the title 1rst row), sort ascending on column B, we will see the final sums (at the row 82) of the 2 columns F and G will be no more balanced. The reason why is : the formula of the cell G51 before sorting become wrong after sorting. If instead of using the formula we use a real value, that is 36, then the sort comes out with a correct result, the final sums of the columns F and G are still balanced.

regards
Comment 1 GerardF 2016-02-04 14:57:52 UTC
Calc use the relative reference of your formula :
In G51, you have F49-G50. Means =Substract cell above from the cell one cell left and one cell above.
After sorting the formula do the same.
This is the normal behavior of Calc.

However, you can change this in Options :
Go to Tools > Options > LO Calc > General, and check "Update reference when sorting range of cell".
Comment 2 Buovjaga 2016-02-10 19:02:35 UTC
No response from original reporter, so I assume this can be closed as not a bug.