The middle value of the sorted data (the average of the two middle values when n is even); robust to outliers.
Example
Common mistakes
Learn it in the course
Mean, median and mode: the typical value · 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: how to find them · 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.
Measures of spread: range, SD and quartiles · Two couriers with the same average delivery time, and why only one keeps the promise: measures of spread from range and variance to standard deviation (calculated step by step), quartiles, IQR and the coefficient of variation.
Types of charts: choosing the right one · The main types of charts (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.
Sample vs population and the normal distribution · Sample vs population: why we study samples to learn about all users, why the bell-shaped normal distribution shows up everywhere, and how the central limit theorem ties them together.
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 n values from smallest to largest. If n is odd, take the value in position (n+1)/2. If n is even, there are two middle values, in positions n/2 and n/2+1, and the median is their mean:
Here x(k) is the k-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.
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 n=7 the median is in position (7+1)/2=4, so it is $28. The mean is 442/7≈63.14 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 n=8, the middle positions are 4 and 5, and the median is (28+31)/2=29.5 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 482/8=60.25 to 3,038/8=379.75 dollars.
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 n 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.