QUARTILE_INC
function QUARTILE_INC(arg1: number[] | ApiRange = null, arg2: number = null): number
Description
Returns the quartile of a data set, based on percentile values from 0..1, inclusive.
Parameters
The array or cell range of numeric values for which the quartile value will be returned.
- arg2
number
null The quartile value to return: minimum value = 0; 1st quartile = 1; median value = 2; 3rd quartile = 3; maximum value = 4.
Returns
number
Try It
const oWorksheet = Api.GetActiveSheet();
var valueArr1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
var quart = 1;
// Place the numbers in cells
for (var i = 0; i < valueArr1.length; i++) {
oWorksheet.GetRange("A" + (i + 1)).SetValue(valueArr1[i]);
}
//method params
var array = oWorksheet.GetRange("A1:A12");
var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.QUARTILE_INC(array, quart); //0...1 inclusive
oWorksheet.GetRange("C1").SetValue(ans);