Created attachment 120401 [details] Third column = averge calculated by Writer, Fourth column = expected values Hello, I have found, that when the table is crated in Writer and some volues need to be aveged, than Writer makes addition instead of making average. Probably is is not critical, but it present in multiple versions (also on Ubuntu 14.04 ... guess, tha it is 4.2.3.x). Have a nice day ;)
I can confirm with Version: 5.1.0.0.alpha1+ Build ID: c5fefe46fc9dca3942b2fc33ffd1f7e041d450e6 TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2015-11-04_07:04:49 Locale: cs-CZ (cs_CZ.UTF-8) and LibreOffice 3.5.0 Build ID: d6cde02
On pc Debian x86-64 with master sources updated today, I could reproduce this In fact, any name which doesn't correspond to an existing function returns a sum as a range without function. I mean these are equivalent: - =xxxxx<A1:B1> - =<A1:B1> - =SUM<A1:B1> If you want average, you should use "MEAN" function. So the problem is Writer should popup an error message in case of incorrect function.
I tried to understand why it doesn't popup an error msg but failed to do it. Here is some pointer: http://opengrok.libreoffice.org/xref/core/sw/source/core/bastyp/calc.cxx#676
OK, thanks for all reactions. So if I understand correctly, the problem is in that Writer does not have included "average" function, but "mean" function works fine (already tried). And there is no warning to user, when undefined function is used. I am not good in reading in code, but I guess that usable functions are these: http://opengrok.libreoffice.org/xref/core/sw/source/core/bastyp/calc.cxx#55 ?
Let's give a try with this patch: https://gerrit.libreoffice.org/#/c/19919/ With it, LO displays an error for unknown function but perhaps it's not that simple and I miss some cases. Let's wait for the review of this one.
Thank you a lot! :) As soon as possible I will try to apply the patch somehow, now I can´t quickly find the way how to do it. In fact I am just a little advanced user, not a programmer.
If interested + have some time you can first build the sources by following this link https://wiki.documentfoundation.org/Development/BuildingOnLinux then apply the patch. You may also wait for the review, if it's ok, you'll find a daily master containing the fix 24 to 48 hours afterwards there: http://dev-builds.libreoffice.org/daily/master/
OK, thank you for advice, now I am busy at school, so maybe I will try it on weekend.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=010ed5e6f4505647b0f9043d1cf5001db2057e0d tdf#95687: Wrong function names in Formula Writer are considered as SUM It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Review for 5.0 branch, see https://gerrit.libreoffice.org/#/c/20106/
Great work! :-) I will test it ASAP after release. Have a nice day.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0acf23044bdf003bee2df1e8a3066ed157343401 Revert "tdf#95687: Wrong function names in Formula Writer are considered as SUM" It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Sorry the fix was wrong, see http://cgit.freedesktop.org/libreoffice/core/commit/?id=0acf23044bdf003bee2df1e8a3066ed157343401 for details.
I submitted a new patch here: https://gerrit.libreoffice.org/#/c/20113/ Hope it'll be fine. Indeed, when using non existent functions ("foo" included), there's an error but now PythonTest_sw_python with set_expression test (which was ko) is ok.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e110397a2816037b421bdcdeed0a2fdab5cd99d7 tdf#95687: Wrong function names in Formula Writer are considered as SUM It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0bba0524c5090831653e7acae09e26b18f6bb481 Revert "tdf#95687: Wrong function names in Formula Writer are considered as SUM" It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
The last patch was wrong because variables aren't dealt anymore with this. What a mess to fix this! :-(
Thank you to Mike for having noticed it was related to tdf#61228, in fact, it's even a dup of it. *** This bug has been marked as a duplicate of bug 61228 ***