GNOME Bugzilla – Bug 523250
SUMIF database values should be interpreted
Last modified: 2008-05-04 00:11:45 UTC
Please describe the problem: I'm having a problem with sumfif: Cells (and/or conditions) that contain dashes aren't matched properly. Ie, if I have the string '2007-2 in a cell and use "2007-2" as a condition, the cell is not matched. This seems to be specific to the use of only numbers and dashes, the problem does not occur when other characters (such as letters or a plus sign) are added. I don't have Excel around for comparison but I think I have seen this working on Excel before. It was working in gnumeric 1.6 at any rate. Steps to reproduce: See attachment for a few examples. Every column that has 6 in the last row is correct, every column with a 0 is incorrect. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 107570 [details] Gnumeric file showing the problem
The problem is that the value you search for ("2007-2-1") gets interpreted as a date and gnumeric ends up searching for the corresponding value, i.e., 39114. Some testing is required to determine what the correct behaviour is, i.e., when and what should be interpreted.
Created attachment 107714 [details] [review] Tentative patch This patch is a little bit bigger than I hoped for, but we need the date conventions in order to do the matching right.
Seems reasonable. Passing in the DateConvention is a tad ugly but there's not much choice now. In time we she probably just move to a 'Context' to hold all the different conventions and position information.
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
*** Bug 417305 has been marked as a duplicate of this bug. ***
*** Bug 531111 has been marked as a duplicate of this bug. ***