PERCENTRANK_INC

function PERCENTRANK_INC(
  arg1: number[] | ApiRange = null,
  arg2: number = null,
  arg3: number = null,
): number

Description

Returns the rank of a value in a data set as a percentage (0..1, inclusive) of the data set.

Parameters

arg1number[] | ApiRangedefault: null

The array or range of data with numeric values that defines relative standing.

arg2numberdefault: null

The value for which the rank will be returned.

arg3numberdefault: null

An optional value that identifies the number of significant digits for the returned percentage, three digits if omitted (0.xxx%).

Returns

number

Try It

var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
var column1 = [1, 0, 7, 10];
var column2 = [3, 2, 5, 8];
var column3 = [5, 4, 3, 6];
var column4 = [7, 6, 5, 4];

for (var i = 0; i < column1.length; i++) {
   oWorksheet.GetRange("A" + (i + 1)).SetValue(column1[i]);
}
for (var j = 0; j < column2.length; j++) {
   oWorksheet.GetRange("B" + (j + 1)).SetValue(column2[j]);
}
for (var n = 0; n < column3.length; n++) {
   oWorksheet.GetRange("C" + (n + 1)).SetValue(column3[n]);
}
for (var m = 0; m < column4.length; m++) {
   oWorksheet.GetRange("D" + (m + 1)).SetValue(column4[m]);
}

var oRange = oWorksheet.GetRange("A1:D4");
oWorksheet.GetRange("D5").SetValue(oFunction.PERCENTRANK_INC(oRange, 2, 4));

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).