GNOME Bugzilla – Bug 662551
SUMPRODUCT
Last modified: 2011-11-01 17:26:11 UTC
I have marked this as an analytics problem but it may just be a documentation problem. In Gnumeric SUMPRODUCT performs implicit intersection when evaluating its arguments. In OpenFormula/ODF SUMPRODUCT is specifically defined not to perform implicit intersection. We need to figure out what happens in Excel. One can test fort implict intersection by A1: 1 C3: =SUMPRODUCT(A1:A128>0) In Gnumeric with implicit intersection, C3 evaluates to 0. In LibreOffice without implicit intersection, C3 evaluates to 1. If Excel's behaviour matches Gnumeric's we should document the distinction between OpenFormula and Gnumeric. If Excel's behaviour matches LibreOffice's we should consider changing Gnumeric's behaviour.
There might be some relationship with bug #533507.
Excel 2k7 gives me "0".
So, Excel also seems to use implicit intersection. We need to change the description of SUMPRODUCT to emphasize that it is not strictly ODF compatible.
Either that, or we grow a SUMPRODUCT.ODF
I would prefer an ODF.SUMPRODUCT (which is the format we are using if we would encounter a claimed ODF function that we do not recognize).
I guess, on second thought since the ODF. prefix is used for exactly that purpose an intentional function ought to be named differently, e.g. SUMPRODUCT.ODF.
ODF.SUMPRODUCT is fine. We aren't going to have an overlap.
We now have ODF.SUMPRODUCT. Note, that the above analysis is not right. The differences between our (Excel's) SUMPRODUCT and ODF.SUMPRODUCT is that the former ignores TRUE while the latter considers it 1. Leaving open for odf mapping on read.
mappings on read (and write) are done: on read: SUMPRODUCT -> ODF.SUMPRODUCT ORG.GNUMERIC.SUMPRODUCT -> SUMPRODUCT (default mapping) on write: ODF.SUMPRODUCT -> SUMPRODUCT SUMPRODUCT -> ORG.GNUMERIC.SUMPRODUCT (default mapping)
I have tracked down the initial issue: A1:A4 has x,1,2,3 B1:B4 has y,1,2,3 C1 has =SUMPRODUCT(A1:A4*B1:B4) or =ODF.SUMPRODUCT(A1:A4*B1:B4) Gnumeric yields #VALUE in C1. LibreOffice (for SUMPRODUCT) yields 14. ODF/OpenFormula is pretty clear: unless specifically stated otherwise, if a function is given an error value as argument the result should be an error value. Clearly A1*A4 is an error so the result according to ODF/OpenFormula should be an error. LibreOffice's result is therefore not in accordance with ODF/OpenFormula. Note that the result for =SUMPRODUCT(A1:A4,B1:B4) or =ODF.SUMPRODUCT(A1:A4,B1:B4) is 14 in both Gnumeric and Libreoffice since both ignore the string values.
I filed a bug against LibreOffice: https://bugs.freedesktop.org/show_bug.cgi?id=42481