AreaEval range;
ValueEval[] values;
// when criteria is a boolean value
values = new ValueEval[] {
new NumberEval(0),
new StringEval("TRUE"), // note - does not match boolean TRUE
BoolEval.TRUE,
BoolEval.FALSE,
BoolEval.TRUE,
BlankEval.instance,
};
range = EvalFactory.createAreaEval("A1:B3", values);
confirmCountIf(2, range, BoolEval.TRUE);
// when criteria is numeric
values = new ValueEval[] {
new NumberEval(0),
new StringEval("2"),
new StringEval("2.001"),
new NumberEval(2),
new NumberEval(2),
BoolEval.TRUE,
};
range = EvalFactory.createAreaEval("A1:B3", values);
confirmCountIf(3, range, new NumberEval(2));
// note - same results when criteria is a string that parses as the number with the same value
confirmCountIf(3, range, new StringEval("2.00"));
// when criteria is an expression (starting with a comparison operator)
confirmCountIf(2, range, new StringEval(">1"));