Unordered list
2, 14, 5, 9, 7 has 5 as its third entry, but 5 is not the median.
Before this page: compare numbers, place them in order, and count the values in a list.
The median divides an ordered list into two equal-sized parts. Put the values in ascending order before choosing the middle.
Order the values, then select the third value of the five.
The median is 7. The original order does not affect it; only the ordered positions matter.
With an even number of values, no single value has equal numbers of values on both sides. Take the mean of the two middle values.
Order the values, then average the second and third values.
The median is 7, even though 7 is not in the list. The halfway position can produce a value that was never measured.
Counting positions in the original order can select the wrong value. The position only has meaning after the values have been sorted.
2, 14, 5, 9, 7 has 5 as its third entry, but 5 is not the median.
2, 5, 7, 9, 14 has 7 in the middle, so the median is 7.
For an odd list, the median has the same number of values on each side. For an even list, the two middle values have the same number of values on each side of the pair.
There is one value before 6 and one after 8. The pair is centred in the ordered list, and its midpoint is 7.