Ask Your Question
1

Calc sum function bug?

asked 2018-02-12 09:17:10 +0200

mikalzet gravatar image

updated 2018-03-07 17:24:17 +0200

erAck gravatar image

If I open a new Calc spreadsheet, and I paste in the following numbers in a column ( cells A1 to A6): 0,0086584 0,00159885 0,0016177 0,00164682 0,00151831 0,00155874 In cell A7 I get the correct result if I write the formula = A1 +A2 + A3 + A4 +A5+ A6 ( 0,01659882 ) But if I press the sum icon, and have A7 formula as =SOMMA(A1:A6) I get a wrong answer ( 0,0016177 )

Is this a bug, or am I not getting something here?

edit retag flag offensive close merge delete

Comments

Cannot reproduce, unless cells A1, A2, A4, A5, and A6 are text (in which case it's expected and normal).

Mike Kaganski gravatar imageMike Kaganski ( 2018-02-12 09:36:42 +0200 )edit

4 Answers

Sort by » oldest newest most voted
1

answered 2018-02-12 10:59:05 +0200

Lupp gravatar image

updated 2018-02-12 11:12:16 +0200

(Explaining the comment by @Mike Kaganski to more detail:)

The only explanation not resorting to sorcery is that the somewhats contained in A1, A2, A4, A5, A6 and looking like numbers are actually texts, and that the only true number in the range is in A3.
SUM() simply ignores text content while addition using the operator "+" automatically converts the operands to numbers if applicable, and otherwise returns an error #VALUE!.

Try {=SUM(VALUE(A1:A6))} (entered for array-evaluation) to confirm. Also use View > Value Highlighting Ctrl+F8 to check for my thesis.

A valuable way to always clearly distinguish text from numbers is to NOT set an explicit alignment for the respective cells. The default alignment aligns texts left and numbers right.

Down with silly automatisms! (There are a few clever ones, too.)

edit flag offensive delete link more
0

answered 2018-03-07 17:24:00 +0200

erAck gravatar image

See also the Text to Number FAQ.

edit flag offensive delete link more
0

answered 2018-02-13 10:53:45 +0200

mikalzet gravatar image

Thanks, that was it.

edit flag offensive delete link more

Comments

This is not an answer and should be a comment instead. See guidelines for asking.

Jim K gravatar imageJim K ( 2018-02-13 16:10:33 +0200 )edit
-1

answered 2018-03-07 16:51:24 +0200

The sum function does not work. I had to forward a document from one computer to the one with Excel for a summation. =sum(#:#) where # is your data, does not compute. Even if you hand enter all the numbers the old fashioned way with =#+#+#. Nada. But the exact same function in excel worked in seconds.

edit flag offensive delete link more

Comments

Because Excel does some stupid always-on automatism that delivers different results depending on the locale in which the spreadsheet is opened. In LibreOffice it depends on what setting is activated under Tools -> Options -> Calc -> Formula, Detailed Calculation Settings, Custom, Details, Conversion from text to number. The Excel equivalent is "Convert also locale dependent", but recommended is "Generate #VALUE! error" to spot such errors early.

erAck gravatar imageerAck ( 2018-03-07 17:31:03 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-02-12 09:17:10 +0200

Seen: 109 times

Last updated: Mar 07