Top Description Constructors Methods
org.apache.poi.ss.formula.functions

public final Class Sumif

extends Var2or3ArgFunction
Class Inheritance
Imports
org.apache.poi.ss.formula.eval.AreaEval, .ErrorEval, .EvaluationException, .NumberEval, .RefEval, .ValueEval, org.apache.poi.ss.formula.functions.CountUtils.I_MatchPredicate

Implementation for the Excel function SUMIF

Syntax :
SUMIF ( range, criteria, sum_range )

Parameter descriptions
rangeThe range over which criteria is applied. Also used for addend values when the third parameter is not present
criteriaThe value or expression used to filter rows from range
sum_rangeLocates the top-left corner of the corresponding range of addends - values to be added (after being selected by the criteria)

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static double
accumulate(AreaEval aeRange, CountUtils.I_MatchPredicate mp, AreaEval aeSum, int relRowIndex, int relColIndex)

private static AreaEval
private static AreaEval

Returns:

a range of the same dimensions as aeRange using eval to define the top left corner.
createSumRange
(ValueEval eval, AreaEval aeRange)

private static ValueEval
eval(int srcRowIndex, int srcColumnIndex, ValueEval arg1, AreaEval aeRange, AreaEval aeSum)

public ValueEval
public ValueEval
private static double
Inherited from org.apache.poi.ss.formula.functions.Var2or3ArgFunction:
evaluate

Constructor Detail

Sumifback to summary
public Sumif()

Method Detail

accumulateback to summary
private static double accumulate(AreaEval aeRange, CountUtils.I_MatchPredicate mp, AreaEval aeSum, int relRowIndex, int relColIndex) throws EvaluationException
convertRangeArgback to summary
private static AreaEval convertRangeArg(ValueEval eval) throws EvaluationException
createSumRangeback to summary
private static AreaEval createSumRange(ValueEval eval, AreaEval aeRange) throws EvaluationException
Returns:AreaEval

a range of the same dimensions as aeRange using eval to define the top left corner.

Exceptions
EvaluationException:
if eval is not a reference
evalback to summary
private static ValueEval eval(int srcRowIndex, int srcColumnIndex, ValueEval arg1, AreaEval aeRange, AreaEval aeSum)
evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1)

Implements org.apache.poi.ss.formula.functions.Function2Arg.evaluate.

Doc from org.apache.poi.ss.formula.functions.Function2Arg.evaluate.

see Function#evaluate(ValueEval[], int, int)

Annotations
@Override
evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2)

Implements org.apache.poi.ss.formula.functions.Function3Arg.evaluate.

Doc from org.apache.poi.ss.formula.functions.Function3Arg.evaluate.

see Function#evaluate(ValueEval[], int, int)

Annotations
@Override
sumMatchingCellsback to summary
private static double sumMatchingCells(AreaEval aeRange, CountUtils.I_MatchPredicate mp, AreaEval aeSum) throws EvaluationException