TRY NEW VERSION

STDEVA

STDEVA(args) → { number }

Estimates standard deviation based on a sample, including logical values and text. Text and the false logical value have the value 0; the true logical value has the value 1.

Parameters:

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

Up to 255 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 = [1, 0, 0, 0, "text", 1, 0, 0, 2, 3, true, false, 6, 8, 10, 12];

// 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.STDEVA(
  1,
  0,
  0,
  0,
  "text",
  1,
  0,
  0,
  2,
  3,
  true,
  false,
  6,
  8,
  10,
  12
); //includes logical values

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

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

Resulting document