--- src/testcases/org/apache/poi/ss/formula/functions/TestMatch.java (revision 8456866d309da18eac5eb8127d405234c0527e06) +++ src/testcases/org/apache/poi/ss/formula/functions/TestMatch.java (revision ) @@ -89,6 +89,7 @@ confirmInt(2, invokeMatch(new NumberEval(10), ae, MATCH_EXACT)); confirmInt(4, invokeMatch(new NumberEval(9), ae, MATCH_SMALLEST_GTE)); confirmInt(1, invokeMatch(new NumberEval(20), ae, MATCH_SMALLEST_GTE)); + confirmInt(5, invokeMatch(new NumberEval(3), ae, MATCH_SMALLEST_GTE)); assertEquals(ErrorEval.NA, invokeMatch(new NumberEval(20), ae, MATCH_EXACT)); assertEquals(ErrorEval.NA, invokeMatch(new NumberEval(26), ae, MATCH_SMALLEST_GTE)); } --- src/java/org/apache/poi/ss/formula/functions/Match.java (revision 8456866d309da18eac5eb8127d405234c0527e06) +++ src/java/org/apache/poi/ss/formula/functions/Match.java (revision ) @@ -228,8 +228,7 @@ return i-1; } } - - throw new EvaluationException(ErrorEval.NA); + return size-1; } private static LookupValueComparer createLookupComparer(ValueEval lookupValue, boolean matchExact) {