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
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".
No response from original reporter, so I assume this can be closed as not a bug.