Bug 71612

Summary: Other: =WENN(ODER(ISTLEER(G1);ISTLEER(H1));"";G1-H1)
Product: LibreOffice Reporter: Thomas Schweikle <tps>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: CLOSED NOTABUG    
Severity: normal    
Priority: medium    
Version: 4.1.3.2 release   
Hardware: Other   
OS: Windows (All)   
Whiteboard: BSA
Crash report or crash signature: Regression By:
Attachments: Window showing what is seen on my desktop for a file using "ODER"
File with formula used

Description Thomas Schweikle 2013-11-14 15:27:58 UTC
Created attachment 89199 [details]
Window showing what is seen on my desktop for a file using "ODER"

Problem description: 
This shall be "" if G1 or H1 or both are empty.
If both fields carry values it shall print G1-H1.
But it prints only "" if *BOTH*, G1 *and* H1 are empty. In cases G1 *or* H1 are empty it prints "#WERT!". In case both hold values it prints G1-H1. The function "ODER" acts as "UND".
If I switch from "ODER" to "UND" it doesn't change anything.

Steps to reproduce:
1. Install LibreOffice
2. Open Spreadsheet
3. Enter the formula and values

Current behavior:
Prints G1-H1 in case G1, or H1, or both hold values

Expected behavior:
Only print G1-H1 if both fields hold values

Operating System: Windows XP
Version: 4.1.3.2 release
Comment 1 Thomas Schweikle 2013-11-14 15:29:51 UTC
Created attachment 89200 [details]
File with formula used
Comment 2 Thomas Schweikle 2013-11-14 16:39:03 UTC
This might not really be a bug then a feature. isempty() is false in any case if the cell holds a formula. isnumber() is true, if the result shown is a number and false otherwise.
It is a bit difficult to find a formula returning false if no result is shown and true if a result is shown, regardless of the result.
Comment 3 Thomas Schweikle 2013-11-14 16:42:16 UTC
Maybe we need a function returning true if a cell does show something and false if it appears empty (the string printed has length 0).
Comment 4 Eike Rathke 2013-11-14 16:48:14 UTC
You can check with LEN(...)=0