Bug 121575 - Logical function IFS
Summary: Logical function IFS
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.1.3.1 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-21 09:18 UTC by Mario Cataldi
Modified: 2018-11-21 16:28 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
File calc (13.02 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-11-21 13:48 UTC, Mario Cataldi
Details
New version (12.75 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-11-21 16:28 UTC, Mario Cataldi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Cataldi 2018-11-21 09:18:26 UTC
Description:
Libre office Calc Italian

Steps to Reproduce:
1.
Più «se»	
        0<=Value<1	«A»
	1<=Value<1.5	«B»
	1.5<=Value<3	«C»
	3<=Value	«D»


2.
String :  PIÙ.SE(0<=Value<1,"A",1<=Value<1.5,"B",1.5<=Value<3,"C",3<=Value,"D")


Actual Results:
0	B
1.33	B
5.2	B
0.1	B
3.2	B
1.5	B
2.5	B
3	B


Expected Results:

Results
0	A
1.33	B
5.2	D
0.1	A
3.2	D
1.5	B
2.5	C
3	D



Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Mario Cataldi 2018-11-21 09:23:55 UTC
Expected Results:

Results
0	A
1.33	B
5.2	D
0.1	A
3.2	D
1.5	C
2.5	C
3	D
Comment 2 Mike Kaganski 2018-11-21 12:45:09 UTC
Please attach a sample document. I cannot find a function named "PIÙ.SE" in Italian help; so cannot test the step 2. But a document would carry everything required for reproduction.
Comment 3 Eike Rathke 2018-11-21 12:54:02 UTC
PIÙ.SE() should be IFS() (see summary).
Anyhow, conditions like  0<=Value<1  to evaluate whether Value is between [0,1) are wrong as they evaluate as  (0<=Value)<1  which of course is not what was intended; they would need to be expressed as AND(0<=Value;Value<1) or as separate conditions to IFS().
Comment 4 Mario Cataldi 2018-11-21 13:48:55 UTC
Created attachment 146873 [details]
File calc
Comment 5 Mike Kaganski 2018-11-21 14:20:28 UTC
(In reply to Mario Cataldi from comment #4)

See what Eike said. Your formula is incorrect. This one could work:

> =IFS(A12<0;"ERROR";A12<1;"A";A12<1,5;"B";A12<3;"C";TRUE();"D")
Comment 6 Mario Cataldi 2018-11-21 14:32:01 UTC
Then only one condition is correct.
1<Value<1.5 is incorrect?
Comment 7 Mike Kaganski 2018-11-21 15:21:05 UTC
(In reply to Mario Cataldi from comment #6)

The syntax for Calc operators is described in help: https://help.libreoffice.org/latest/en-US/text/scalc/01/04060199.html. You may see that there's no ternary A<B<C operators exist, so you have to use equivalents using AND() and such spreadsheet functions. There is no 1:1 correspondence between standard math notation and Calc syntax.

So yes, "1<Value<1.5" returns something other than you would expect - see Eike's answer.
Comment 8 Mario Cataldi 2018-11-21 16:27:34 UTC
Thank you very much.
Now with the Eike advice it runs correctly.

Bye
Comment 9 Mario Cataldi 2018-11-21 16:28:57 UTC
Created attachment 146882 [details]
New version

Thank you