Created attachment 108443 [details]
simple table to show the issue
Let's say we have a simple two-column table. The first contains a list of unsorted numbers; the second, in each cell, a formula that adds the contents of the cell above the second column with the contents of the adjacent cell of the first column (of course using relative references), thus showing the gradual increase of the values. If we select the contents of the first column and order it (without extending to the second column), the cell references in the first column moving as if they were absolute rather than relative, so the results of the formulas are incorrect. I am attaching a simple table to show the problem.
The issue is present in Linux and Windows both x86
Known problem, already tracked in bug 81633.
See bug 85215 too.
In the master (version 18.104.22.168.alpha1+) it works if you uncheck the configuration option "Update references when sorting range of cells" in Tools > Options > LibreOffice Calc > General _and_ select the column to be sorted without extending the selection to the next column containing summation formulas.
If you check this option, the values seem correct but the formulas have been modified.
Best regards. JBF
*** This bug has been marked as a duplicate of bug 81633 ***