Issue 92604 - sorting fails when formulas are used
Summary: sorting fails when formulas are used
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: Calc
Classification: Application
Component: formatting (show other issues)
Version: OOo 2.4.1
Hardware: All All
: P2 Trivial (vote)
Target Milestone: ---
Assignee: spreadsheet
QA Contact: issues@sc
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2008-08-08 18:12 UTC by wilberw
Modified: 2008-10-30 12:04 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Try sorting A2:C64 and you will that the formulas will be corrupted by the sort process (9.70 KB, application/vnd.oasis.opendocument.spreadsheet)
2008-08-08 18:14 UTC, wilberw
no flags Details
Buggy sort behaviour when relative references and formulas are used (9.76 KB, application/vnd.oasis.opendocument.spreadsheet)
2008-08-09 03:15 UTC, wilberw
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description wilberw 2008-08-08 18:12:44 UTC
I have attached a spreadsheet to demonstrate the failing behaviour.

Select area
A2:C64
and then click Data | Sort --> OK
^^ As can be seen the formulas have been corrupted.
Comment 1 wilberw 2008-08-08 18:14:16 UTC
Created attachment 55662 [details]
Try sorting A2:C64 and you will that the formulas will be corrupted by the sort process
Comment 2 Regina Henschel 2008-08-08 21:44:38 UTC
Please have a look at issue 61936. I think that is the same problem.
Comment 3 wilberw 2008-08-09 03:13:13 UTC
This issue is similar but different to issue 61936. The sort function is buggy
and I have created another spreadsheet called "sortingwithformulasV2.ods" to
demonstrate this. Open up sortingwithformulasV2.ods and select area A2:C4 and
click on "Data | Sort | OK". It appears the sort function is modifying the
relative references based on how far up or down a row moves during the sort.
Before the sort this row:
08/08/2008	=F71/4	Rent
was on row 2. After the sort it had moved down one row and so it then modified
the relative reference down by one:
08/08/2008	=F72/4	Rent
Now have a look at these rows:
11/08/2008	=F72	Food
18/08/2008	=F72	Food
25/08/2008	=F72	Food
01/09/2008	=F72	Food
08/09/2008	=F72	Food
which before the sort where on rows 15-19. After the sort these rows now occupy
4-8 and have a look how the data has been modified:
11/08/2008	=F61	Food
18/08/2008	=F61	Food
25/08/2008	=F61	Food
01/09/2008	=F61	Food
08/09/2008	=F61	Food
and also have a look at row 10:
15/09/2008	=F62	Food
^^ It can clearly be seen that the sort function is modifying relative
references inconsistently changing behaviour radically especially if you use a
function.


This should remain as a P2 priority because "User data is corrupted in an
easy-to-encounter way".

The "Data | Sort" function should include a new option in its "Options" page of
"Preserve relative references" which by default should be ticked as this would
be the behaviour the majority of users would expect when performing a sort.
Comment 4 wilberw 2008-08-09 03:15:19 UTC
Created attachment 55664 [details]
Buggy sort behaviour when relative references and formulas are used
Comment 5 Stefan Weigel 2008-10-30 12:01:35 UTC
Behaviour is correct!

After sorting, the functions refer exactly to the same offset of columns and
rows, they did before sorting. That is exactly what relative references are
meant for.

For your use case you must not use relative but absolute references.

--> Resolution: INVALID
Comment 6 andreschnabel 2008-10-30 12:04:01 UTC
set to invalid as suggested
Comment 7 andreschnabel 2008-10-30 12:04:20 UTC
closed