Bug 143102 - Error calculating sum function
Summary: Error calculating sum function
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-28 12:38 UTC by bruno.dessale
Modified: 2021-06-28 17:27 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Calc file (16.30 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-06-28 12:38 UTC, bruno.dessale
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bruno.dessale 2021-06-28 12:38:54 UTC
Created attachment 173242 [details]
Calc file

Hello,
This is not the first time I have had this problem. The result of a sum is not correct.
Line 54, I make an addition of several terms, the result is correct.
Line 55, I make a sum, one of the terms is not taken into account. All terms have the same format (number).
Best regards,
Bruno Dessale


Version : 6.4.7.2
Build ID : 1:6.4.7-0ubuntu0.20.04.1
Intel® Core™ i3-10110U CPU @ 2.10GHz × 4
Comment 1 [REDACTED] 2021-06-28 14:31:59 UTC
Please 

- open your file
- set View -> Value Highlighting
- watch the color of value in cell F51 (black color indicating text)
- watch the color of value in cell F52 (black color indicating text))
- select cell F51 and watch formula bar showing cell content is "'1,2" 
- select cell F52 and watch formula bar showing cell content is "'2,9" 

=> F51 and F52 are not of type "Number" but of type "Text"

This is not a bug.

[1] LibreOffice Help - Value Highlighting: https://help.libreoffice.org/latest/en-US/text/scalc/01/03080000.html?DbPAR=CALC#bm_id3151384
Comment 2 [REDACTED] 2021-06-28 14:37:25 UTC
(In reply to Uwe Auer from comment #1)
> Please 
> 
> - open your file
> - set View -> Value Highlighting
> - watch the color of value in cell F51 (black color indicating text)
> - watch the color of value in cell F52 (black color indicating text))
> - select cell F51 and watch formula bar showing cell content is "'1,2" 
> - select cell F52 and watch formula bar showing cell content is "'2,9" 
> 
> => F51 and F52 are not of type "Number" but of type "Text"
> 
> This is not a bug.
> 
> [1] LibreOffice Help - Value Highlighting:
> https://help.libreoffice.org/latest/en-US/text/scalc/01/03080000.
> html?DbPAR=CALC#bm_id3151384

Addition: If you type CTRL+SHIFT+F9 then cell F54 also (correctly) calculates to 14,40 (Not clear how you made id to contain 18,50)
Comment 3 bruno.dessale 2021-06-28 15:50:44 UTC
Yes but when I look at the format of the cells F51 and F52 (right click "format cells") I have a number and not a text !

Thanks
Comment 4 [REDACTED] 2021-06-28 16:06:53 UTC
(In reply to bruno.dessale from comment #3)
> Yes but when I look at the format of the cells F51 and F52 (right click
> "format cells") I have a number and not a text !
> 
> Thanks

Formatting a cell *after* there is already data within the cell, never changes the data type. Formatting about representation of data within the same type. You cannot convert data by changing format.

In other words: Looking at the format of a cell is no means to determine the data type of a cell's content (That's why the procedure mentions `View -> Value Highlighting` which is a means to get the data type.
Comment 5 Ming Hua 2021-06-28 16:28:17 UTC
There is also an FAQ page about this "looks like numbers but is actually text" issue on wiki:

https://wiki.documentfoundation.org/Faq/Calc/How_to_convert_number_text_to_numeric_data
Comment 6 m_a_riosv 2021-06-28 17:27:46 UTC
Calc is strict about the convert/use text numbers as number, only happens with direct references, but none using cell ranges.

There are some settings in Menu/Tools/Options/LibreOffice calc/Formula/Detailed calculation settings, but I think no one affects this case.