AVERAGE

AVERAGE(args) → { number }

Returns the average (arithmetic mean) of the specified arguments.

Parameters:

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

Up to 255 numeric values for which the average value will be returned. The first argument is required, subsequent arguments are optional. Arguments can be numbers or names, arrays or references that contain numbers.

Returns:

Type
number

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
var avg = oFunction.AVERAGE(123, 197, 46, 345, 67, 456);
oWorksheet.GetRange("B2").SetValue(avg);
builder.SaveFile("xlsx", "AVERAGE.xlsx");
builder.CloseFile();

Resulting document