Bug 169416 - FILEOPEN XLSX XLS Boolean value is considered incorrectly in IF function
Summary: FILEOPEN XLSX XLS Boolean value is considered incorrectly in IF function
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: XLSX
  Show dependency treegraph
 
Reported: 2025-11-13 11:33 UTC by Gabor Kelemen (Collabora)
Modified: 2025-11-13 23:39 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
The XLSX attachment after hard recalculation (15.37 KB, image/png)
2025-11-13 11:33 UTC, Gabor Kelemen (Collabora)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (Collabora) 2025-11-13 11:33:13 UTC
Created attachment 203948 [details]
The XLSX attachment after hard recalculation

This is a followup to bug 169415

When the XLSX attachment 203946 [details] is opened in Calc, it looks like the same as in Excel, but that is just cached results, a recalculation breaks IF formulae.

1. Open attachment 203946 [details] 
-> C4:C5 shows the value "--" like in Excel; as a result of =IF(B4<2,1,"--") formula, where B4 is boolean FALSE
2. Data - Calculate - Recalculate Hard
-> C4:C5 value becomes "1", meaning Calc considers "FALSE < 2" to be true; Unlike Excel.

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 620(Build:0)
CPU threads: 16; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded

This was never good back to 3.3

For an initial screenshot see attachment 203947 [details]
Comment 1 m_a_riosv 2025-11-13 23:39:52 UTC
Asking Gemini IA, about differences between Excel and Calc on boolean values:
Comparison Behavior
When comparing a logical value to a number (e.g., FALSE < 6),
Excel's distinct data type model can sometimes lead to results that differ from Calc, as the comparison logic can be implementation-defined. Comparisons like FALSE < 6 are evaluated as the numerical comparison 0<6, which yields TRUE.

Data Type:
Excel: Logical values (TRUE/FALSE) are a distinct data type, separate from numbers.
Calc:  Logical values (TRUE/FALSE) are generally represented by numbers: 1 for TRUE and 0 for FALSE.