Bug 84847 - Sorting functions with relative references fails
Summary: Sorting functions with relative references fails
Status: RESOLVED DUPLICATE of bug 81633
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.1.2 release
Hardware: All All
: highest critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-09 18:18 UTC by Fred Olness
Modified: 2015-04-15 19:24 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
SAMPLE FILE: =================== A sample file is attached. Try sorting on the 1st column, then try again with the 2nd column. It is useful to display the formulas using: TOOLS->OPTIONS->LibreOff (16.09 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-10-09 18:18 UTC, Fred Olness
Details
File to demonstrate Calc Bug (16.09 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-10-09 18:21 UTC, Fred Olness
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fred Olness 2014-10-09 18:18:01 UTC
Created attachment 107626 [details]
SAMPLE FILE:  ===================  A sample file is attached.  Try sorting on the 1st column, then try again with the 2nd column.  It is useful to display the formulas using:  TOOLS->OPTIONS->LibreOff
Comment 1 Fred Olness 2014-10-09 18:18:33 UTC
Sorting functions with relative references fails. 

----------------------------------------------------------------------
BRIEF DESCRIPTION OF BUG: ===================

When I sort rows that include a function with relative references 
such as SUM(E3:G3), the relative references are not updated properly.

Note,  if the relative references are NOT inside a function argument,
the sort works correctly. 


----------------------------------------------------------------------
EXAMPLE OF BUG: ===================

For example, if I consider the following spreadsheet
(which is sorted on the 1st column):

-----------------------------------------------------------------
ann	fff	=E1+F1+G1	=SUM(E1:G1)	1	2	3
barney	eee	=E2+F2+G2	=SUM(E2:G2)	4	5	6
charlie	ddd	=E3+F3+G3	=SUM(E3:G3)	7	8	9
-----------------------------------------------------------------

If I now sort on the 2nd column {ddd,eee,fff} the result is WRONG:

-----------------------------------------------------------------
charlie	ddd	=E1+F1+G1	=SUM(E3:G3)	7	8	9
barney	eee	=E2+F2+G2	=SUM(E2:G2)	4	5	6
ann	fff	=E3+F3+G3	=SUM(E1:G1)	1	2	3
-----------------------------------------------------------------

Note the relative references are handled correctly when I use
"=E1+F1+G1" but not when they are inside the argument of the 
function: "=SUM(E3:G3)"

-----------------------------------------------------------------------
TESTED ON:   ===================

I have verifed this bug in Version 4.3.1.2 on BOTH 
Ubuntu Linux (12.04, and 14.04) and Windows (Version 7). 

-----------------------------------------------------------------------
THE BUG WAS NOT PRESENT BEFORE: ===================

I also verified that this bug is NOT present in Version 4.1.x.x. 

-----------------------------------------------------------------------
WORK-AROUND: ===================

The only work-around I know is to revert back to Version 4.1.x.x. 

-----------------------------------------------------------------------
SAMPLE FILE:  ===================

A sample file is attached. 
Try sorting on the 1st column, then try again with the 2nd column. 
It is useful to display the formulas using: 
TOOLS->OPTIONS->LibreOfficeCalc->VIEW->Display Formulas

-----------------------------------------------------------------------
COMMENTS: ===================

I consider this bug to be ESSENTIAL/TOP-MOST priority. 

For example, with the current bug I cannot use LibreOffice 
for basic functions as sorting class grades by name or by test score.
Comment 2 Fred Olness 2014-10-09 18:21:47 UTC
Created attachment 107627 [details]
File to demonstrate Calc Bug
Comment 3 Jean-Baptiste Faure 2014-10-09 18:51:48 UTC
Known problem. Already tracked by bug report 81633.

The more recent version not affected is 4.2.6.3

Best regards. JBF

*** This bug has been marked as a duplicate of bug 81633 ***