TRIMMEAN

function TRIMMEAN(arg1: ApiRange | number[] = null, arg2: number = null): number

Description

Returns the mean of the interior portion of a set of data values.

Parameters

arg1ApiRange | number[]default: null

The range or array of values to trim and average.

arg2numberdefault: null

The fractional number of data points to exclude from the top and bottom of the data set.

Returns

number

Try It


var oWorksheet = Api.GetActiveSheet();
var argumentsArr = [1, 2, 3, 4];

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

// Get values from the range
var data = oWorksheet.GetRange("A1:A4");

// Calculate the TRIMMEAN of the range A1:A6
var oFunction = Api.GetWorksheetFunction();
var result = oFunction.TRIMMEAN(data, 0.6);
oWorksheet.GetRange("B1").SetValue(result);

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