Returns the mean of the interior portion of a set of data values.
Name | Type | Description |
arg1 | ApiRange | Array.<number> | The range or array of values to trim and average. |
arg2 | number | The fractional number of data points to exclude from the top and bottom of the data set. |
builder.CreateFile("xlsx"); 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); builder.SaveFile("xlsx", "TRIMMEAN.xlsx"); builder.CloseFile();