MEDIAN

function MEDIAN(args: number | string | [] | ApiRange = null): number

Description

Returns the median, or the number in the middle of the set of given numbers.

Parameters

argsnumber | string | [] | ApiRangedefault: null

Up to 255 numeric values for which the median will be calculated. The first argument is required, subsequent arguments are optional.

Returns

number

Try It



const oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
var median = oFunction.MEDIAN(4,45,12,34,3,54,2,2);
oWorksheet.GetRange("C1").SetValue(median);



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