TRY NEW VERSION

STDEV_P

STDEV_P(args) → { number }

Calculates standard deviation based on the entire population given as arguments (ignores logical values and text).

Parameters:

Name Type Description
args number | string | Array.<number> | ApiRange

Up to 255 numeric values for which the standard deviation will be calculated. The first argument is required, subsequent arguments are optional.

Returns:

Type
number

Example

Copy code
builder.CreateFile("xlsx");

const oWorksheet = Api.GetActiveSheet();

var valueArr = [
  3, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 13, 14, 3, 5, 17, 18,
];

// Place the numbers in cells
for (var i = 0; i < valueArr.length; i++) {
  oWorksheet.GetRange("A" + (i + 1)).SetValue(valueArr[i]);
}

var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.STDEV_P(3,2,3,4,5,6,7,8,9,10,11,12,0,1,13,14,3,5,17,18); 

oWorksheet.GetRange("C1").SetValue(ans);

builder.SaveFile("xlsx", "STDEV_P.xlsx");
builder.CloseFile();

Resulting document