Issue 93886

Summary: Sorting cells with references results in invalid references
Product: Calc Reporter: tastenton <rolf.lochbuehler>
Component: editingAssignee: spreadsheet <spreadsheet>
Status: CLOSED DUPLICATE QA Contact: issues@sc <issues>
Severity: Trivial    
Priority: P4 CC: issues, rb.henschel
Version: OOo 2.4.1Keywords: oooqa
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description tastenton 2008-09-14 17:12:20 UTC
Enter into the six fields A1..B3
  b  =B2-1
  c  1
  a  =B2+1
and then sort by column A. This results in a reference error in field B1:
  a  =B#REF!+1
  b  =B3-1
  c  1
Instead I'd expect to see
  a  =B3+1
  b  =B3-1
  c  1

Can see this behavior also in a rather popular commercial spreadsheet 
application, so this might be something like an "industry standard bug". ;-) 

Might be related to issue 81349.
Comment 1 Regina Henschel 2008-09-14 18:03:50 UTC
What do you want, is impossible using relative address references. When the cell
content of B3 is the formula "=B2+1", then this mean in fact,"Take the content
of the cell, which is one row before me and add 1." When now the content of B3
comes by sorting into the cell B1, it still has the meaning "Take the content of
the cell, which is one row before me and add 1." But now in 'one row before me'
is nothing. That is the way relative addressing and sorting works actually.

Issue 81349 is indeed a feature request to get a new way of sorting. I'll solve
this issue as duplicate therefore.

To get a proper sorting, you must
1. use absolute address references
2. output the sorting to a new place or sort a linked copy of the list.
In this way the references point to the correct values in the unsorted list.

*** This issue has been marked as a duplicate of 81349 ***
Comment 2 Regina Henschel 2008-09-14 18:04:23 UTC
closing duplicate