Version

UltraCalcFunctionMedian Class

Calculates the median value of a specified list of numeric values.
Syntax
'Declaration
 
Public Class UltraCalcFunctionMedian 
   Inherits BuiltInFunctionBase
public class UltraCalcFunctionMedian : BuiltInFunctionBase 
Remarks

MEDIAN(Value1, value2, ..., valueN)

Value1, value2, ..., valueN are any number of numeric values or references to numeric values for which you want the median value found. If any argument is an error value, or there are no numeric values within the series of arguments, then MEDIAN() will return an error value.

The median is the middle value of the sorted list of numeric values (you do not need to sort Value1, value2, ..., valueN prior to passing them to the MEDIAN() function). When the list contains an odd number of values, the median will be the value at position CEIL(N/2). For example, the median of the 5-value list 0, 20, 30, 50, 80, is the value in the third position: 30. When the list contains an even number of values, the median will be the average of the two values in the middle. For example, the median of the 4-value list 7, 20, 30, 45, is the average of the two middle elements (20 and 30): 25. Note that the value of the MEDIAN() varies most from the arithmetic mean of the sorted list when the distribution of values tends to favor one side or the other of that arithemtic mean. For example, the arithmetic mean of the 5-value list 1, 2, 3, 21, 43 is 14 but it's median value is 3.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also