Class PercentRank
- java.lang.Object
-
- org.apache.poi.ss.formula.functions.PercentRank
-
- All Implemented Interfaces:
Function
public final class PercentRank extends java.lang.Object implements Function
Implementation of 'the Excel function PERCENTRANK() Syntax:
PERCENTRANK(array, X, [significance])array The array or range of data with numeric values that defines relative standing.
X The value for which you want to know the rank.
significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK uses three digits (0.xxx).
Returns a number between 0 and 1 representing a percentage.- Since:
- POI 5.1.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueEval
evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex)
static java.util.List<ValueEval>
getValues(ValueEval eval, int srcRowIndex, int srcColumnIndex)
static NumberEval
interpolate(double x, double closestMatchBelow, double closestMatchAbove, NumberEval belowRank, NumberEval aboveRank, int significance)
static double
round(java.math.BigDecimal bd, int significance)
-
-
-
Field Detail
-
instance
public static final Function instance
-
-
Method Detail
-
evaluate
public ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex)
- Specified by:
evaluate
in interfaceFunction
- Parameters:
args
- the evaluated function arguments. Empty values are represented withBlankEval
orMissingArgEval
, nevernull
.srcRowIndex
- row index of the cell containing the formula under evaluationsrcColumnIndex
- column index of the cell containing the formula under evaluation- Returns:
- The evaluated result, possibly an
ErrorEval
, nevernull
. Note - Excel uses the error code #NUM! instead of IEEE NaN, so when numeric functions evaluate toDouble.NaN
be sure to translate the result toErrorEval.NUM_ERROR
.
-
interpolate
@Internal public static NumberEval interpolate(double x, double closestMatchBelow, double closestMatchAbove, NumberEval belowRank, NumberEval aboveRank, int significance)
-
round
@Internal public static double round(java.math.BigDecimal bd, int significance)
-
getValues
@Internal public static java.util.List<ValueEval> getValues(ValueEval eval, int srcRowIndex, int srcColumnIndex) throws EvaluationException
- Throws:
EvaluationException
-
-