Sort, then find the middle
The median is the middle value of sorted data: half the observations below it, half above. Odd count: the middle value itself, position (n + 1)/2. Even count: the average of the two middle values, positions n/2 and n/2 + 1. That is the entire method. The sorting is the work; the locating is trivial. Everything else about the median is understanding why you would choose it over the mean.
A batsman's last nine innings: 45, 12, 78, 33, 45, 0, 56, 45, 21. Sorted: 0, 12, 21, 33, 45, 45, 45, 56, 78. Nine values, so the 5th is the median: 45. The mean is 37.2, dragged down by the duck and the 12. For a typical innings, 45 is the honest summary: half his innings beat it, half fell short, and the disasters are priced in without being amplified. With an even count, say 6, 8, 9, 11, 13, 15, the middle pair is 9 and 11 and the median is their average, 10, a value nobody scored: medians of even samples can be constructed numbers.
Medians you will meet in the wild
Official statistics reach for the median wherever money is involved: median household income, median house price, median pay by occupation. Survival analysis reports median survival, the time by which half the group has had the event, because the mean is often uncomputable when some subjects are still event-free at the study's end. In each case the median is chosen for the property this page is built on: it describes the middle case faithfully while extremes, missing tails and open-ended categories push at it in vain.
When the median beats the mean
The median ignores the sizes of extremes entirely: change the 78 to 780 and the median stays 45 while the mean jumps to 115. That resistance is exactly what skewed data need (incomes, house prices, waiting times), and exactly wrong for totals: a city's income tax take depends on the sum, hence the mean, extremes included. Report the pair when they disagree; the gap between mean and median is itself a quick skew diagnostic, since the mean always leans toward the tail.
Forgetting to sort. The median of unsorted data is just whichever value sits in the middle of the list as typed, a number with no meaning at all. In spreadsheets this is the MEDIAN function versus eyeballing the central row: trust the function.
Frequently asked questions
How do I find the median with an even number of values?
Average the two middle values after sorting: positions n/2 and n/2 + 1. For 6 values, the median is the average of the 3rd and 4th.
Can the median be a value not in the dataset?
Yes, with even counts: the average of the middle pair is often unobserved, like the 10 in the example. With odd counts it is always an observed value.
Median or mean: which should I report?
Both when they differ. The median for typical values in skewed data; the mean whenever totals, rates or later calculations build on it.