Apache OpenOffice (AOO) Bugzilla – Issue 85000
ODFF: SUMIF's 3rd parameter is handled differently from Excel
Last modified: 2013-08-07 15:15:24 UTC
In Calc, SUMIF's 3rd parameter expects a cell range, and Calc expects the geometry of that cell range to match that of the 1st parameter. In Excel, however, the 3rd parameter's range geometry does not have to match the 1st parameter's; Excel takes the upperleft cell address and use the geometry of the 1st parameter to turn that into a cell range.
Created attachment 50667 [details] test case
Created attachment 50670 [details] patch to fix this issue
changing issue type to PATCH
also good for usability IMHO, I managed to screw up my SUMIF regions to not be exactly the same size (by 1 row), and was stumped for quite a while just the other day.
In cws odff: sc/source/core/tool/interpr1.cxx 1.51.38.5
Actually there was more to it. Excel silently ignores out-of-sheet-bounds conditions if the resulting range would exceed max columns or rows, e.g. SUMIF(A1:B2;1;IV65536) does not complain but would at most sum cell IV65536. The attached patch even crashed under that condition. Btw, nCol4,nRow4,nTab4 weren't needed at all. sc/source/core/tool/interpr1.cxx 1.51.38.6
Yeah I noticed the crash. It's pretty bad. I'm on my way to fixing it. Thanks for pointing that out.
Created attachment 50721 [details] revised patch to fix the crash.
Yes, shrinking the source range is the better approach. sc/source/core/tool/interpr1.cxx 1.51.38.7 Btw, MAXCOLCOUNT - 1 is identical to MAXCOL ;-)
>Btw, MAXCOLCOUNT - 1 is identical to MAXCOL ;-) Doh! It was just a few lines down from MAXCOLCOUNT! ;-)
Created attachment 50723 [details] let's switch to using MAXCOL and MAXROW instead of MAXCOLCOUNT and MAXROWCOUNT.
Reassigning to QA for verification.
Created attachment 51778 [details] TestCaseSpecification
Created attachment 51779 [details] Testdocuments for Test Case Specification
verified in internal build cws_odff
closed because fix available in builds OOO300_m9 and DEV300_m33