Class Countif

java.lang.Object
org.apache.poi.ss.formula.functions.Fixed2ArgFunction
org.apache.poi.ss.formula.functions.Countif
All Implemented Interfaces:
ArrayFunction, Function, Function2Arg

public final class Countif extends Fixed2ArgFunction implements ArrayFunction
Implementation for the function COUNTIF

Syntax: COUNTIF ( range, criteria )

Parameter descriptions
range   is the range of cells to be counted based on the criteria
criteriais used to determine which cells to count
  • Constructor Details

    • Countif

      public Countif()
  • Method Details

    • evaluate

      public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1)
      Description copied from interface: Function2Arg
      Specified by:
      evaluate in interface Function2Arg
    • evaluateArray

      public ValueEval evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex)
      Evaluated in array context (the result feeds an array-mode function such as SUMPRODUCT, or the cell is part of an array formula): a multi-cell range as criteria means one count per criterion.
      Specified by:
      evaluateArray in interface ArrayFunction
      Parameters:
      args - the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.
      srcRowIndex - row index of the cell containing the formula under evaluation
      srcColumnIndex - column index of the cell containing the formula under evaluation
      Returns:
      The evaluated result, possibly an ErrorEval, never null. Note - Excel uses the error code #NUM! instead of IEEE NaN, so when numeric functions evaluate to Double.NaN be sure to translate the result to ErrorEval.NUM_ERROR.
      Since:
      6.0.0