DEVSQ

function DEVSQ(args: number = null): number

Description

Returns the sum of squares of deviations of data points from their sample mean.

Parameters

argsnumberdefault: null

Up to 255 numerical values for which to find the sum of squares of deviations. The first argument is required, subsequent arguments are optional.

Returns

number

Try It

var oWorksheet = Api.GetActiveSheet();
var argumentsArrA = [34, 244];
var argumentsArrB = [769, 445];
var argumentsArrC = [76, 677];
var argumentsArrD = [89, 56];
var argumentsArrE = [98, 13];

// Place the numbers in cells
for (var a = 0; a < argumentsArrA.length; a++) {
   oWorksheet.GetRange("A" + (a + 1)).SetValue(argumentsArrA[a]);
}
for (var b = 0; b < argumentsArrB.length; b++) {
   oWorksheet.GetRange("B" + (b + 1)).SetValue(argumentsArrB[b]);
}
for (var c = 0; c < argumentsArrC.length; c++) {
   oWorksheet.GetRange("C" + (c + 1)).SetValue(argumentsArrC[c]);
}
for (var d = 0; d < argumentsArrD.length; d++) {
   oWorksheet.GetRange("D" + (d + 1)).SetValue(argumentsArrD[d]);
}
for (var e = 0; e < argumentsArrE.length; e++) {
   oWorksheet.GetRange("E" + (e + 1)).SetValue(argumentsArrE[e]);
}

// Analyze the range of data 
var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.DEVSQ(oWorksheet.GetRange("A1:E2"));
oWorksheet.GetRange("E3").SetValue(ans);

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).