跳到主要内容

VAR_S

Estimates variance based on a sample (ignores logical values and text in the sample).

Syntax

expression.VAR_S(args);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
argsRequirednumber | ApiName | ApiRange | number[]Up to 255 numeric values for which the variance will be calculated. The first argument is required, subsequent arguments are optional. Arguments can be numbers, names, ranges, or arrays of numbers.

Returns

number

Example

This example shows how to estimate variance based on a sample (ignores logical values and text in the sample).

// How to estimate variance based on a sample.

// Use a function to estimate variance ignoring logical and text values.

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
let result = func.VAR_S(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
worksheet.GetRange("B2").SetValue(result);