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

public final Class PercentRank

extends Object
implements Function
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.functions.Function
Imports
org.apache.poi.ss.formula.eval.*, org.apache.poi.ss.util.NumberToTextConverter, org.apache.poi.util.Internal, java.math.BigDecimal, .RoundingMode, java.util.ArrayList, .Collections, .List

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

Field Summary

Modifier and TypeField and Description
public static final Function

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private ValueEval
calculateRank(List<Double> numbers, double x, int significance, boolean recurse)

public ValueEval
evaluate(ValueEval[]
the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.
args
,
int
row index of the cell containing the formula under evaluation
srcRowIndex
,
int
column index of the cell containing the formula under evaluation
srcColumnIndex
)

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

public static List<ValueEval>
getValues(ValueEval eval, int srcRowIndex, int srcColumnIndex)

public static NumberEval
interpolate(double x, double closestMatchBelow, double closestMatchAbove, NumberEval belowRank, NumberEval aboveRank, int significance)

public static double
round(BigDecimal bd, int significance)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceback to summary
public static final Function instance

Constructor Detail

PercentRankback to summary
private PercentRank()

Method Detail

calculateRankback to summary
private ValueEval calculateRank(List<Double> numbers, double x, int significance, boolean recurse)
evaluateback to summary
public ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex)

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

Parameters
args:ValueEval[]

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

the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.

srcRowIndex:int

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

row index of the cell containing the formula under evaluation

srcColumnIndex:int

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

column index of the cell containing the formula under evaluation

Returns:ValueEval

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

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.

getValuesback to summary
public static List<ValueEval> getValues(ValueEval eval, int srcRowIndex, int srcColumnIndex) throws EvaluationException
Annotations
@Internal
interpolateback to summary
public static NumberEval interpolate(double x, double closestMatchBelow, double closestMatchAbove, NumberEval belowRank, NumberEval aboveRank, int significance)
Annotations
@Internal
roundback to summary
public static double round(BigDecimal bd, int significance)
Annotations
@Internal