Bug 107892 - MAX.SI function doesn't work with negative values
Summary: MAX.SI function doesn't work with negative values
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.6.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:5.4.0 target:5.3.4
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-16 11:50 UTC by R1M
Modified: 2017-05-20 16:16 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of an example with formula and data columns (96.75 KB, image/jpeg)
2017-05-16 11:52 UTC, R1M
Details
full file that gives bad results for MAX.SI function (18.05 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-05-16 11:53 UTC, R1M
Details

Note You need to log in before you can comment on or make changes to this bug.
Description R1M 2017-05-16 11:50:40 UTC
Description:
Selecting a range and looking for the max value gives 0 when all the values are <0, not the greatest negative value

Steps to Reproduce:
1. set a column with title "Zone2" for example
2. set aside a column with <0 numbers
3. place in a cell the title from first column
4. place in a cell forumla

Actual Results:  
value is 0

Expected Results:
value is the max available value.
It works fine with MIN.SI and positive values


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0
Comment 1 R1M 2017-05-16 11:52:37 UTC
Created attachment 133358 [details]
Screenshot of an example with formula and data columns

to highlight the situation
Comment 2 R1M 2017-05-16 11:53:57 UTC
Created attachment 133359 [details]
full file that gives bad results for MAX.SI function

the full .ods file wher I got the bug for MaX.SI function (but not for MIN.SI)
Comment 3 Julien Nabet 2017-05-16 13:11:37 UTC
With LO 5.3.3 on Win7, I could reproduce this.
Comment 4 R1M 2017-05-16 17:36:50 UTC
Confirmed also xith this file on Version: 5.2.6.2 (Build ID: 1:5.2.6-2~bpo8+1)
OS :Linux 4.5; VCL : kde4; Locale : fr-FR (fr_FR.UTF-8); Calc: group
Is ti possible to also tag this version with the bug or 5.3.2.2 is enough to cover previous ones on other OS?
Comment 5 Julien Nabet 2017-05-16 19:06:17 UTC
Version field must correspond to the earliest affected version.
Comment 6 Julien Nabet 2017-05-16 21:54:04 UTC
I submitted a patch for review on master:
https://gerrit.libreoffice.org/#/c/37693/
Comment 7 Commit Notification 2017-05-17 17:40:01 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=20d3a60b41bda2513723c145d919f584840b1056

tdf#107892: fix negative values case with maxifs

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2017-05-17 19:50:43 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f6d7bd1f525d3930c48b61abb2e91418f2c66ca5&h=libreoffice-5-3

tdf#107892: fix negative values case with maxifs

It will be available in 5.3.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2017-05-20 16:16:38 UTC
Zdeněk Crhonek committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=53fd8223b73c683e9e4d92b2ad3aabed368eff0e

tdf#107892 add MAXIFS test

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.