Bug 99732 - sum('123) = 0 wrong answer without warning
Summary: sum('123) = 0 wrong answer without warning
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.2.2 release
Hardware: Other macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-08 18:33 UTC by Spencer Graves
Modified: 2017-05-31 10:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
LOcalc sum function treats apparent numbers as 0 if storage is not numeric (13.64 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-05-08 18:33 UTC, Spencer Graves
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Spencer Graves 2016-05-08 18:33:11 UTC
Created attachment 124913 [details]
LOcalc sum function treats apparent numbers as 0 if storage is not numeric

c7 = number
c8 displays as a number but is not

c7+c7 gives the anticipated answer 
sum(c7:c8) treats c8 as 0 and gives a wrong answer without warning. 

Sometimes but not always, I see a single quote (') preceding the "number".  In the attached, I could not see how to fix this problem.
Comment 1 Spencer Graves 2016-05-08 18:35:07 UTC
I tested this with LO 5.1.2.2, 5.0.4.2, and 4.4.0.2
Comment 2 m_a_riosv 2016-05-08 22:02:47 UTC
Calc is very strict in accept text as number in formulas, and only try to convert text to values in direct references, but none in a SUM() function.

Resolved as notabug, please if you are not agree reopen it.
Comment 3 Spencer Graves 2016-05-08 23:09:52 UTC
Thanks for the review.  My real problem is that when I paste a number like $1,234.56 into a cell, sometimes it is converted to numeric and sometimes it stays as character, which looks like a number and computes as a number with "+" but not "sum".  

Worse, I could not find an easy way to convert the text into a number.  Sometimes the number starts with a single quote, like ('1234).  If I see that, I can remove the single quote.  Otherwise, I can't just type the number over, because the cell is now committed to text.  I tried typing the number in manually without "$" and "," and found that the cell was committed to text and converted the number to text.  I have to insert a new cell, carefully enter the number manually, then manually delete the cell committed to text.  

You are correct, that it's not a problem with "sum" -- nor with "+":  If either were changed, it would break lots of spreadsheets people have used for years.  

Thanks, Spencer Graves
Comment 4 m_a_riosv 2016-05-09 15:41:06 UTC
In Ask you can find help about how to deal with numbers as text, searching 'numbers text calc', e.g.

https://ask.libreoffice.org/en/question/1843/changing-text-to-numbers/

What is the bug?

Please detail step by step, from where you got the data, and how do you enter them in the spreadsheet?, so someone can try to reproduce the issue.
Comment 5 Buovjaga 2016-10-21 18:37:27 UTC
(In reply to m.a.riosv from comment #4)
> Please detail step by step, from where you got the data, and how do you
> enter them in the spreadsheet?, so someone can try to reproduce the issue.

Spencer:
Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information.
Comment 6 QA Administrators 2017-05-02 11:37:15 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2017-05-31 10:46:41 UTC
Dear Bug Submitter,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-20170531