Bug 160775

Summary: Incorrect Calculation Result in SUM Function with Mixed Data Types
Product: LibreOffice Reporter: tikirah710
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEEDINFO ---    
Severity: normal CC: miguelangelrv, robert
Priority: medium    
Version: 3.3.4 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description tikirah710 2024-04-22 09:14:08 UTC
Description:
When using the SUM function in LibreOffice Calc to calculate the sum of a range containing mixed data types (numeric and non-numeric), the calculation result is incorrect.

Steps to Reproduce:
1. Open a new Calc spreadsheet.
2. In cell A1, enter the value "10".
3. In cell A2, enter the value "5".
4. In cell A3, enter the text "Test".
5. In cell A4, enter the formula "=SUM(A1:A3)".
6. Press Enter to calculate the sum.

Actual Results:
The actual result is an error, or in some cases, the result may be the concatenation of numeric and non-numeric values, such as "105Test".

Expected Results:
The expected result is 15, as the SUM function should ignore non-numeric values and only sum the numeric values in the range A1:A3.


Reproducible: Sometimes


User Profile Reset: No

Additional Info:
It affects users who rely on the SUM function to calculate the sum of ranges containing mixed data types.
- The issue persists even after recalculating the spreadsheet or restarting the application.
Comment 1 Robert Großkopf 2024-04-22 13:30:53 UTC
I will get "15" with SUM function in Calc.
So I couldn't confirm any buggy behavior here.

Tested with
Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01
CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded

And also LO 7.4.7.2 on the same system.

Which version do you use?
Comment 2 m_a_riosv 2024-04-22 21:07:33 UTC
Please test in safe mode, Menu/Help/Restart in Safe Mode