Bug 108811 - SOMME.SI / SUMIF equality tests returns wrong values - is not the same than IF equality test - in some cases
Summary: SOMME.SI / SUMIF equality tests returns wrong values - is not the same than I...
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.7.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-27 10:40 UTC by david.lacorre
Modified: 2022-06-10 14:00 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description david.lacorre 2017-06-27 10:40:08 UTC
Description:
The equality test used in SUMIF function does not return the same value than the IF equality test for which appears to be the same cases, resulting in simingly wrong values.





Steps to Reproduce:
Exemple can be reproduced as follow, using the format <Cell> = "Value in cell" :

A2 = "Aaa"
A3 = "BingoXyZ(ART)"
A4 = "Ddd"

B2 = "1"
B3 = "1"
B4 = "1"

C2 = "Aaa"
C3 = "BingoXyZ(ART)"
C4 = "Ddd"

D3 = "=SUMIF($A$2:$A$4;C2;$B$2:$B$4)"
D4 = "=SUMIF($A$2:$A$4;C2;$B$2:$B$4)"
D5 = "=SUMIF($A$2:$A$4;C2;$B$2:$B$4)"

E2 = "=SI(C2=A2;1;0)"
E3 = "=SI(C2=A2;1;0)"
E4 = "=SI(C2=A2;1;0)"

The goal of this exemple is to show that the label "BingoXyZ(ART)" is not being recognized and so counted by the SUMIF function while testing equality with IF proves that the 2 values in A3 and C3 should have been reported as the same.


Actual Results:  
Value returned in SUMIF cells are :

D2 = "1"
D3 = "0"
D4 = "1"


Expected Results:
Results should have been :

D2 = "1"
D3 = "1"
D4 = "1"


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0
Comment 1 david.lacorre 2017-06-27 10:42:38 UTC
Forgot to change the formulas in the exemple given after copy and paste.

Should have been 

D3 = "=SUMIF($A$2:$A$4;C2;$B$2:$B$4)"
D4 = "=SUMIF($A$2:$A$4;C3;$B$2:$B$4)"
D5 = "=SUMIF($A$2:$A$4;C4;$B$2:$B$4)"

E2 = "=SI(C2=A2;1;0)"
E3 = "=SI(C3=A3;1;0)"
E4 = "=SI(C4=A4;1;0)"
Comment 2 m_a_riosv 2017-06-27 12:06:20 UTC
SUMIF takes care of regular expression to search, while IF not.

You have the options to use regular expressions, wildcards or non in
Menu/Tools/Options/LibreOffice calc/calculate,

There are parenthesis '(' and ')' what are part of regular expression.

https://help.libreoffice.org/Common/List_of_Regular_Expressions
Comment 3 Povi 2022-06-08 08:35:46 UTC Comment hidden (spam)
Comment 4 Michael Warner 2022-06-10 13:51:50 UTC
Based on Comment 2 I think this should be re-opened as a usability issue. However any solution would have impacts to backwards compatibility and maybe the ODF spec, etc. Solving this would not be simple, and the bug will likely just be re-closed as WF. But to spur discussion I will reopen anyway.