How to Find the Median

Finds the middle value of a data set when it is sorted. With an even count, it is the average of the two middle values.

The median is the value that sits in the middle once the data is sorted. Because it depends only on the ordering, extreme values cannot drag it around.

If the count nn is odd, the median is the single middle value. If nn is even, it is the average of the two middle values.

median={x(n+1)/2(n odd)xn/2+xn/2+12(n even)\text{median} = \begin{cases} x_{(n+1)/2} & (n \text{ odd}) \\ \dfrac{x_{n/2} + x_{n/2+1}}{2} & (n \text{ even}) \end{cases}

Example

For 12, 15, 18, 20, 25 there are five values, an odd count. The third value in order, 18, is the median.

With only 12, 15, 18, 20 the count is even, so the median is the average of the two middle values: 15+182=16.5\dfrac{15 + 18}{2} = 16.5.

Median or mean?

For salaries or house prices, where a few large values pull the average up, the median is much closer to the typical case.

A large gap between the two tells you the data is skewed.