Apache OpenOffice (AOO) Bugzilla – Issue 63781
sort of range containing references to itself: adjust references to new cell containg value referenced prior to sort
Last modified: 2013-02-07 22:32:28 UTC
When sorting a column of negative numbers (or a combination of positive and negative numbers), the values will not be sorted properly, and some values may be changed in the process.
cannot reproduce; can you give a step-by-step description? thanks
Occurs when column to be sorted is filled using equations that reference cells to be sorted, ie. A1=0, A2=A1-5, A3=A1-10 etc, then sorted in ascending order. In hindsight, this problem would also exist for just positive numbers as well. When I first encountered this, I did not realize the column had been entered this way (as I had imported a friends data from MS:Ex). The solution to this would be to record where referenced cells are moved to, and reassign the references in the refering cell apon completion of the sort.
The problem is due to sorted cell dependency of parent cell. A1 is greater than A2 and A3, therefore moved to A3. But links from A2 and old_A3 does not corrected (still refer to A1).
Fix to my previous post: link from cells A2 and old_A3 are corrected. But as if that cell simply moved N rows up, when N depends on sort.
you are right braedley, for this to work properly Calc would have to first sort by result and then adjust the cell references to the new cells containing the value. this is an enhancement request. probably duplicate but couldn't find it.