GNOME Bugzilla – Bug 162923
TREND function in scalar context
Last modified: 2005-01-10 00:10:54 UTC
On win32, but may be cross-platform. Given the example from the gnumeric manual: Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1, and the cells B1, B2, ... B5 23.2, 25.8, 29.9, 33.5, and 42.7. Its output is "#VALUE!". The manual says that its output should be: TREND(A1:A5,B1:B5) equals 156.52. However, running this same test in Excel XP, the function's value is 12.06522
I can replicate on Debian sid
Interesting: This call of TREND would return an array of 5 values. If you enter the function as an array function you get the values: 12.1115533, 15.79824913, 21.61188487, 26.71654064, 39.76177205 If you enter it as a non-array function I would have expected that we get the first of those numbers rather than #VALUE!. That looks like a bug to me. The example in the manual is clearly wrong.
See also http://groups-beta.google.com/group/comp.apps.spreadsheets/browse_thread/thread/e611b344b1cf7835/3a1dd13caba983f3?q=gnumeric&_done=%2Fgroups%3Fq%3Dgnumeric%26start%3D0%26scoring%3Dd%26safe%3Dimages%26ie%3DUTF-8%26lr%3D%26hl%3Den%26&_doneTitle=Back+to+Search&&d#3a1dd13caba983f3
1) I've fixed the example in the docs, and the translations 2) There was a minor thinko in the function evaluator that was fixed. I'd forgotten that value_intersect handled the array[0] in a non-scalar case.