Md = x̃
Sort the values in order and take the one in the middle. With an even count there are two values in the
middle, and the median is their mean. The formula is a definition, so it looks like a name rather
than a calculation: the work is in sorting and counting to the middle.
The median splits the sorted list in the middle: as many values stand before it as after it. That is why
it resists outliers: it does not matter how far away the largest value is, only that it is above.
Worked examples
Even count. 2, 4, 4, 4, 5, 5, 7, 9 is already sorted. There are eight values, so the middle lies
between the fourth and the fifth, 4 and 5. The median is (4 + 5) / 2 = 4.5.
Odd count. 3, 1, 2 sorts to 1, 2, 3. The middle value is 2, and no division is needed.
With an outlier. Add 100 to the first list. Now there are nine values, and the fifth, 5, is the
median. The mean jumps from 5 to 15.6 at the same time.
Common mistakes
- Taking the middle value without sorting first. The middle of 3, 1, 2 is 1, but the median is 2.
- Taking one of the two middle values with an even count. It is the mean of both that counts.
- Assuming the median must be in the list. 4.5 is not among 2, 4, 4, 4, 5, 5, 7, 9.
Common questions
What is the median if all the values are equal?
That same value. 6, 6, 6, 6 has a median of 6, and the mean is 6 too.
Does the median have to be in the list?
Only with an odd count. With an even count it is the mean of the two in the middle, and that number is
often not in the list.
Median or mean for salaries?
Usually the median. A few very high salaries pull the mean up, so most people earn less than “the
average”. The median salary is the one half earn more than and half less than.