Should have "case NE: return cmpResult != 0;" on line 131: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Countif.java?annotate=734243 There are also problems with string to number conversion, for example: '<>123' should always match string values, even '123' (the only thing it doesn't match is 123). '>5' should never match any string value, even '6' No string-to-number conversion is ever required for operators besides '=' and '' (no operator, very similar to '=')
Fixed in svn 740088 Junits added. This bug was initiated due to the post 'About the evaluation of "countif"' from Miki Haruki (三木 春樹) on poi-user. Thanks for the detailed problem description.