TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

DSTDEVP

DSTDEVP(arg1, arg2, arg3) → { number | string | boolean }

Calculates the standard deviation based on the entire population of selected database entries.

Parameters:

Name Type Description
arg1 ApiRange

Is the range of cells that makes up the list or database. A database is a list of related data.

arg2 number

Is either the label of the column in double quotation marks or a number that represents the column's position in the list.

arg3 string

Is the range of cells that contains the conditions you specify. The range includes a column label and one cell below the label for a condition.

Returns:

Type
number | string | boolean

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue("Name");
oWorksheet.GetRange("B1").SetValue("Month");
oWorksheet.GetRange("C1").SetValue("Sales");
oWorksheet.GetRange("A2").SetValue("Alice");
oWorksheet.GetRange("B2").SetValue("Jan");
oWorksheet.GetRange("C2").SetValue(200);
oWorksheet.GetRange("A3").SetValue("Andrew");
oWorksheet.GetRange("B3").SetValue("Jan");
oWorksheet.GetRange("C3").SetValue(300);
oWorksheet.GetRange("A4").SetValue("Bob");
oWorksheet.GetRange("B4").SetValue("Jan");
oWorksheet.GetRange("C4").SetValue(250);
oWorksheet.GetRange("E1").SetValue("Month");
oWorksheet.GetRange("E2").SetValue("Jan");
oWorksheet.GetRange("F1").SetValue("Sales");
oWorksheet.GetRange("F2").SetValue(">200");
var oRange1 = oWorksheet.GetRange("A1:C4");
var oRange2 = oWorksheet.GetRange("E1:F2");
oWorksheet.GetRange("F4").SetValue(oFunction.DSTDEVP(oRange1, "Sales", oRange2));
builder.SaveFile("xlsx", "DSTDEVP.xlsx");
builder.CloseFile();

Resulting document