Class 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
    • Field Detail

      • instance

        public static final Function instance
    • Method Detail

      • evaluate

        public ValueEval evaluate​(ValueEval[] args,
                                  int srcRowIndex,
                                  int srcColumnIndex)
        Specified by:
        evaluate in interface Function
        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.
      • 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)