跳到主要内容

STANDARDIZE

Returns a normalised value from a distribution characterised by a mean and standard deviation.

Syntax

expression.STANDARDIZE(arg1, arg2, arg3);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe value to normalize.
arg2RequiredApiRange | ApiName | numberThe arithmetic mean of the distribution.
arg3RequiredApiRange | ApiName | numberThe standard deviation of the distribution, a positive number.

Returns

number

Example

const worksheet = Api.GetActiveSheet();

let valueArr = [5, -2, 10];

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

// method params
let x = worksheet.GetRange("A1");
let mean = worksheet.GetRange("A2");
let stdDev = worksheet.GetRange("A3");

let func = Api.GetWorksheetFunction();
let ans = func.STANDARDIZE(x, mean, stdDev);

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