Returns the median of a set of numbers. In a set containing an uneven number of values, the median will be the number in the middle of the set and in a set containing an even number of values, it will be the mean of the two values in the middle of the set.
MEDIAN(Number1; Number2; ...; Number30)
Number1, Number2, ..., Number30 are values or ranges, which represent a sample. Each number can also be replaced by a reference.
for an odd number: =MEDIAN(1;5;9;20;21) returns 9 as the median value.
for an even number: =MEDIAN(1;5;9;20) returns the average of the two middle values 5 and 9, thus 7.