Find the Median
Every dataset hides a central point that divides it into two equal halves. That point is the median – one of the most important measures of central tendency in statistics. Unlike the arithmetic mean, the median ignores how extreme the highest and lowest values are, which makes it the go-to metric for skewed distributions such as household income, rent prices, or medical costs.
What Is the Median?
The median is the value separating the higher half from the lower half of a sorted dataset. Formally, it is the number at position (n + 1) / 2 when n values are arranged in ascending order. If n is even, the median equals the arithmetic mean of the two central values.
Key properties of the median:
- Robust to outliers. A single extreme value (say, $5,000,000 in a list of salaries) barely shifts the median, while the mean can jump dramatically.
- Works with ordinal data. Even when data can only be ranked (e.g., customer ratings: poor → fair → good → excellent) but not averaged meaningfully, the median still applies.
- Unique for every dataset. Any set of real numbers has exactly one median.
How to Find the Median Step by Step
Regardless of dataset size, the procedure follows three stages:
- Sort all values in ascending order (smallest to largest).
- Count the number of values – denote it n.
- Locate the middle position:
- n is odd → the median is the single middle value.
- n is even → the median is the mean of the two middle values.
Finding the Median of an Odd-Numbered Dataset
Dataset: 12, 3, 7, 18, 5
Step 1 – Sort: 3, 5, 7, 12, 18
Step 2 – Count: n = 5 (odd)
Step 3 – Position: (5 + 1) / 2 = 3 → the 3rd value
Median = 7
Visually, 7 sits exactly in the center with two values on each side.
Finding the Median of an Even-Numbered Dataset
Dataset: 12, 3, 7, 18, 5, 22
Step 1 – Sort: 3, 5, 7, 12, 18, 22
Step 2 – Count: n = 6 (even)
Step 3 – Positions: n / 2 = 3 and (n / 2) + 1 = 4 → 7 and 12
Median = (7 + 12) / 2 = 9.5
Because there is no single middle value, the median falls between the two central numbers.
Median Formula
For a sorted dataset x₁ ≤ x₂ ≤ … ≤ xₙ:
| Dataset size | Median formula |
|---|---|
| n is odd | x₍n+1₎/₂ |
| n is even | (xₙ/₂ + x₍n/₂₎₊₁) / 2 |
The subscripts refer to positions in the sorted array, not the original order.
Median vs Mean vs Mode
These three measures each describe “the center” of data, but they do it differently.
| Property | Median | Mean (Average) | Mode |
|---|---|---|---|
| Definition | Middle value | Sum ÷ count | Most frequent value |
| Affected by outliers | No | Yes | No |
| Requires numerical data | Ordinal or numerical | Numerical only | Any type |
| Always exists | Yes | Yes | Not always |
| Typical use | Skewed distributions | Symmetric distributions | Categorical data |
Example showing the difference: In the set {1, 2, 2, 3, 100}:
- Mean = (1 + 2 + 2 + 3 + 100) / 5 = 21.6
- Median = 2
- Mode = 2
The mean is pulled far from the “typical” value by the outlier 100. The median and mode both correctly represent the cluster around 2.
When to Use the Median
Choose the median over the mean in these situations:
- Income and wealth data. The U.S. Census Bureau reports median household income precisely because billionaire earnings distort the mean.
- Real estate prices. A handful of luxury mansions can double the average home price while leaving the median nearly unchanged.
- Reaction times or response latencies in experiments. These distributions are typically right-skewed with occasional very long delays.
- Likert-scale surveys. Responses such as “strongly disagree” through “strongly agree” are ordinal; averaging them is statistically questionable, but finding the median is valid.
- Test scores with ceiling or floor effects. If almost everyone scores near the maximum, the median better reflects the group’s performance.
Common Mistakes When Finding the Median
- Skipping the sort. The most frequent error – picking the middle element of the unsorted array.
- Averaging incorrectly for even n. Simply picking one of the two middle numbers instead of computing their mean.
- Confusing median and mean. Especially in word problems where “average” is used loosely to mean “typical.”
- Ignoring repeated values. Duplicates still occupy their own position in the sorted list; do not collapse them.
This article is for educational purposes. For formal statistical analysis, consult a qualified statistician or the relevant methodological guidelines.