median
The middle value of the sorted data (the average of the two middle values when n is even); robust to outliers.
The median is the middle value of the data once it is sorted: half of the observations are at or below it, half at or above. It cares only about the order of values, not about how large the extremes are, which is why a single huge order barely moves it.
To find it, sort the values from smallest to largest. If is odd, take the value in position . If is even, there are two middle values, in positions and , and the median is their mean:
Here is the -th value after sorting. In Sheets or Excel, =MEDIAN(range) does the sorting for you.
Use the median when the question is "what does a typical customer, order or session look like?" and the data is skewed, as order values, time to first purchase, revenue per user and page load times usually are. Unlike the mean, the median can't be multiplied by the count to give a total, so keep the mean for revenue forecasts. The median is also the second quartile (Q2) and the 50th percentile; its natural partner for spread is the interquartile range. A big gap between mean and median is a quick signal of skewness or outliers.
Example
Seven CatChow orders on a Saturday, as exported by time: $31, $24, $284, $28, $35, $22, $18.
Odd count. Sort first: 18, 22, 24, 28, 31, 35, 284. With the median is in position , so it is $28. The mean is dollars, more than twice the median, because of the $284 shelter order.
Even count. An eighth order of $40 arrives. Sorted: 18, 22, 24, 28, 31, 35, 40, 284. Now , the middle positions are 4 and 5, and the median is dollars. Note that it isn't one of the actual orders.
Robustness check. If the shelter's order had been $2,840 instead of $284, the median would still be $29.50, while the mean of the eight orders would jump from to dollars.
Common mistakes
- Forgetting to sort. The middle row of an export ordered by date or ID is not the median.
- Picking one of the two middle values when is even instead of averaging them. Small samples are where this changes the answer most.
- Multiplying the median by the order count to forecast revenue. Only the mean is tied to totals; the median will under-forecast right-skewed revenue.
- Averaging medians across days or segments. The median of the combined data is generally not the mean of the daily medians. Recompute it from the raw rows.
- Letting the median hide the tail. It deliberately ignores extremes, so when the tail matters (slow deliveries, failed payments) report a high percentile such as p90 alongside it.
Learn it in the course
- Typical value: mean, median, mode · Mean, median, mode and trimmed mean on real-looking CatChow orders: what each one answers, why one bulk order can fool the average, and how not to average averages.
- Outliers and skewed data · Why product metrics have long tails, how to find outliers with the IQR rule, and what to do with them: fix errors, segment different customers, and never delete whales without thinking.
- Spread: range, SD and quartiles · Two couriers with the same average delivery time, and why only one keeps the promise: range, variance, standard deviation, quartiles, IQR and the coefficient of variation.
- Charts: choosing the right one · Histograms, box plots, bar, pie, scatter and line charts: which question each one answers, how bin width and axes change the story, and the classic ways charts mislead.
- Samples, populations and the normal distribution · Why we study samples to learn about all users, and why the bell curve shows up everywhere.