The Excel MEDIAN function returns the median (middle number) in the supplied set of data. For example, =MEDIAN(1,2,3,4,5) returns 3.
Purpose:
Get the median of a group of numbers.
Return Value:
A number representing the median.
Syntax:=MEDIAN (number1, [number2], …)

Examples:
When the number of values provided is odd, MEDIAN returns the middle number:
=MEDIAN(1,2,3,4,5) // returns 3
=MEDIAN(1,4,5,7,11) // returns 5
When the number of values provided is even, MEDIAN returns the average of the two middle numbers:
=MEDIAN(1,2,3,4,5,6) // returns 3.5
=MEDIAN(1,2,4,6,8,9) // returns 9
In the worksheet shown above, the formulas in H5 and H6 are:
=MEDIAN(B5:B16) // returns 83.5
=MEDIAN(D5:D16) // returns 80
Note: MEDIAN ignores the empty cell in D5:D16 and returns the middle number in the eleven values provided.