Description: When opening an Excel file (.xlsx) in LibreOffice Calc, conditional formatting does not fully override the number format styling applied in Excel. Steps to Reproduce: 1.Create a new file in Microsoft Excel. 2.Set a cell to Number format where negative numbers are displayed in red font. 3.Enter a negative numeric value in the cell. 4. Apply conditional formatting to the same cell: - Condition: value < 0 - Background color: red - Font color: white 5. Save the file as .xlsx. 6. Open the file in LibreOffice Calc. Actual Results: - The conditional formatting background color (red) is applied correctly. - The font color remains red, inherited from the number format for negative values. As a result, the text is red on a red background, making it hard to read. Expected Results: - Conditional formatting should override the number format font color, as it does in Microsoft Excel. - The text color should be white, matching the conditional formatting rule. Reproducible: Always User Profile Reset: No Additional Info: - Microsoft Excel correctly applies the conditional formatting (red background with white text). This issue affects interoperability with Excel files that rely on conditional formatting for visual clarity. LibreOffice version: 25.8.3 OS: Windows 11 Pro 24H2
Created attachment 205099 [details] Excel VS Libreoffice
Please paste here the information on Menu/Help/About LibreOffice (There is an icon to copy) Please attach a sample file(s), reduce the size as much as possible without private information, and paste in the answer the information in Menu/Help/About LibreOffice, there is a copy icon. Please test in safe mode, Menu/Help/Restart in Safe Mode
This issue is not about Conditional Formatting (CF), xlsx files nor Excel. The conflict is the classic Direct Formatting (DF) vs Styles Formatting (SF) (aka which one takes priority). In comment 0, in the initial situation the DF for positive numeric values includes the "Automatic" font color, whereas for negative values the DF for the font color is [RED]. The Style for this initial situation is "Default". When you apply the new Custom Style (i.e. "White" font, "Red" background) to those cells (whether by means of CF, or directly on the cells), the prior "Automatic" font color changes to "White" on positive numeric values, but the negative values keep their Direct Format ("[RED]" font color) over the SF. So, the issue is the priority of Direct Formatting vs Style Formatting.
Version: 25.8.3.2 (X86_64) Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e CPU threads: 12; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win Locale: it-IT (it_IT); UI: it-IT Calc: CL threaded
Created attachment 205143 [details] XLSX file created as described in the bug.
Seems Excel doesn't respect Direct Format over Conditional format. Let's see the UX opinion.
(In reply to m_a_riosv from comment #6) > Seems Excel doesn't respect Direct Format over Conditional format. > Let's see the UX opinion. It is not about CF, but Direct Format vs Style Format. You can achieve the same result without CF; just have the Custom Style format applied unconditionally, and you'll get the same issue. See comment 3.
If CF is active any color setting on the cell whether DF or per CS is ignored by Excel. Shall we do the same? Or consider it as freedom for the user.
Created attachment 205240 [details] CF vs DF vs DF+SF Is this about importing an xlsx file that was originally created in Excel? If that is the case, perhaps the import should rather consider the conditions (for negative numbers in this example), and create a second Custom CF (or rather a second rule within the same Custom CF). This could be tricky when saving back the same file as xlsx. Does Excel deal with CF using Style Format exclusively, as LO Calc does? I don't think so (but I could be wrong). Unfortunately, in terms of Calc, the “correct” way to achieve the OP’s desired effect is to use adequate Styles (and Conditional Formats with adequate rules). Anyway, I repeat, the conflict is not really about CF; this is Direct Format vs Style Format in Calc (i.e. same issue happens without using CF). I am attaching an ods file to show that. (In reply to Heiko Tietze from comment #8) > If CF is active any color setting on the cell whether DF or per CS is > ignored by Excel. Shall we do the same? Or consider it as freedom for the > user. Please note that the question is relevant for exporting (to xls(x)), but not about saving as ods. Questions about why similar xlsx vs ods files look different will rise anyway; ATM such question is about Excel. If any DF/SF logic is modified, be prepare for the question to possibly be about Calc instead. Before changing this DF/SF logic (even if it is about import/export), I would suggest asking for opinions from _experienced_ Calc developers and users.