Averages
How to Find the Median
To find the median, put the numbers in order from smallest to largest and take the middle one. If there is an even number of values, there are two in the middle, and the median is their average. This guide covers both cases step by step, then shows how to find the median of a large list, a frequency table and grouped data, with the mistakes that most often give a wrong answer.
How to find the median in three steps
- Sort the values from smallest to largest. Keep every repeat.
- Count them. Call the count
n. - Take the middle. If
nis odd, the median is the single middle value. Ifnis even, the median is the average of the two middle values.
Example: an odd count
Find the median of 12, 5, 8, 21, 3.
Two values sit below 8 and two sit above it. That balance is what the median means: it splits the sorted list into two halves of equal size.
Example: an even count
Find the median of 14, 9, 3, 11, 6, 20.
The median is 10, which is not in the list. With an even count that is normal: the median is the point halfway between the middle pair.
If you just need the answer for a list of numbers, the median calculator sorts and finds the middle for you, and also gives the quartiles. The mean, median, mode calculator shows the median alongside the other averages.
Why the list has to be sorted
The median is defined as the value with half the data below it and half above. That only makes sense when the values are in order. The middle of an unsorted list is just whichever number happened to be written in the middle.
The first line happens to give the right answer by luck. The second line has the same five numbers and gives a different “middle,” which shows why position in an unsorted list means nothing. Sorting makes the answer depend only on the values.
Sorting in descending order works too: the middle is the same either way. What matters is that the list is in order.
Finding the median of a long list: the (n + 1) ÷ 2 rule
For long lists, counting in from both ends gets slow. Use the position formula instead:
- If the result is a whole number, the median is the value at that position. For 35 values,
(35 + 1) ÷ 2 = 18, so the median is the 18th value. - If the result ends in .5, average the values on either side. For 40 values,
(40 + 1) ÷ 2 = 20.5, so the median is the average of the 20th and 21st values.
The formula works because it counts the same number of places in from each end. In a sorted list of 35 values, the 18th has 17 values below it and 17 above it.
Medians with decimals, negatives and fractions
The method never changes. The only thing that gets harder is sorting, so take care with the order.
Example: decimals
Find the median of 2.4, 1.75, 3.1, 2.05.
When sorting decimals, compare place by place: 2.05 is less than 2.4 because 0 tenths is less than 4 tenths. Writing every value to the same number of decimal places (2.40, 2.05) makes the order obvious; the place value guide explains why.
Example: negative numbers
Find the median of −3, 5, −8, 0, 2.
The more negative a number, the smaller it is, so −8 comes before −3. Picturing the values on a number line keeps the order straight.
Example: fractions
Find the median of 1/2, 3/8, 2/3.
Converting fractions to decimals is the easiest way to sort them. The fraction to decimal calculator handles any fraction, and for an even count you can average the middle two as fractions or as decimals.
How to find the median from a frequency table
A frequency table lists each value with how many times it occurs. You do not need to write out every value. Add a running total (the cumulative frequency) and find which row contains the middle position.
Example: shoe sizes
24 people record their shoe size.
| Shoe size | Frequency | Cumulative frequency |
|---|---|---|
| 7 | 3 | 3 |
| 8 | 6 | 9 |
| 9 | 8 | 17 |
| 10 | 5 | 22 |
| 11 | 2 | 24 |
The cumulative column shows size 8 ends at position 9 and size 9 runs from position 10 to 17, so both middle positions are a 9.
Example: when the middle pair straddles two rows
20 households report how many pets they have.
| Pets | Households | Cumulative |
|---|---|---|
| 0 | 4 | 4 |
| 1 | 6 | 10 |
| 2 | 5 | 15 |
| 3 | 5 | 20 |
The median is 1.5 pets. That sounds odd, but it is correct for an even count, the same as with a plain list.
Estimating the median of grouped data
When data is grouped into ranges, such as “70–79: 14 students,” the exact values are lost, so the exact median cannot be found. You can name the group that contains it and estimate a value inside that group.
Example: 40 test scores in groups
Scores grouped in tens.
| Score | Students | Cumulative |
|---|---|---|
| 50–59 | 4 | 4 |
| 60–69 | 9 | 13 |
| 70–79 | 14 | 27 |
| 80–89 | 10 | 37 |
| 90–99 | 3 | 40 |
The estimate assumes the 14 scores in the 70–79 group are spread evenly across it. The 20th student is 7th of 14 in the group, halfway through, so the estimate lands halfway through the group’s width.
Grouped data uses n ÷ 2 rather than (n + 1) ÷ 2 because the estimate treats the data as continuous. Textbooks differ on whether L is 69.5 or 70; follow the one your course uses, and say which you used.
When the median is the right average
The median and the mean answer different questions. The mean shares the total out evenly; the median finds the middle case. One very large value moves the mean a long way and the median hardly at all: for 1, 1, 1, 2, 50 the median is 1 and the mean is 11.
That is why home prices, incomes and wait times are usually reported as medians. For a full comparison of the averages and when to use each, see how to find the average; for the most frequent value rather than the middle one, see how to find the mode. The median describes the center only; to describe how spread out the values are, pair it with a measure of spread such as the range, covered in how to find the range.
Finding the median in a spreadsheet
Excel and Google Sheets both have a built-in function: =MEDIAN(A1:A20) returns the median of the cells A1 to A20. Blank cells and text are ignored. Check that the cells hold numbers rather than text that looks like numbers, or they will be skipped.
Common mistakes
- Not sorting first. The middle of an unsorted list is not the median.
- Treating (n + 1) ÷ 2 as the answer. It is the position. Look up the value there.
- Taking one middle value when n is even. Average both middle values.
- Dropping repeats. In 4, 7, 7, 7, 9 every 7 counts. Removing two of them changes
nand the middle. - Sorting negatives the wrong way round. −8 is smaller than −3.
- Averaging two group medians. The median of 1, 2, 3 is 2 and of 4 to 10 is 7, but the median of 1 to 10 is 5.5, not 4.5. Combine the raw data and find the median again.
Frequently asked questions
How do you find the median of a set of numbers?
Sort the numbers from smallest to largest, then take the middle one. If there is an even number of values, average the two middle ones. For 12, 5, 8, 21, 3 the sorted list is 3, 5, 8, 12, 21 and the median is 8. For 3, 6, 9, 11, 14, 20 it is (9 + 11) ÷ 2 = 10.
How do you find the median with an even number of values?
Sort the list and find the two values in the middle, then add them and divide by 2. For 2.4, 1.75, 3.1, 2.05 the sorted list is 1.75, 2.05, 2.4, 3.1, so the median is (2.05 + 2.4) ÷ 2 = 2.225. The median does not need to be one of the values.
What is the median of 4, 8, 15, 16, 23, 42?
The median is 15.5. The list is already sorted and has six values, so the middle pair is the 3rd and 4th values, 15 and 16. Their average is (15 + 16) ÷ 2 = 15.5. The mean of the same list is 18, pulled up by the 42.
What is the formula for the median?
For a sorted list of n values, the median is at position (n + 1) ÷ 2. If that is a whole number, take the value there. If it ends in .5, average the values on either side. For grouped data, the estimate is L + ((n ÷ 2 − CF) ÷ f) × h.
Can the median be a decimal?
Yes. With an even count, the median is the average of the middle two values, which can be a decimal even when every value is a whole number. Twenty households with a middle pair of 1 and 2 pets have a median of 1.5 pets. That is correct, not a rounding error.
How do you find the median of a frequency table?
Add a cumulative frequency column, find the middle position with (n + 1) ÷ 2, and read which value covers that position. For 24 shoe sizes, the middle position is 12.5; size 9 covers positions 10 to 17, so the 12th and 13th values are both 9 and the median is 9.
Is the median the same as the average?
The median is one kind of average, but “average” usually means the mean. The mean adds all the values and divides by the count; the median takes the middle of the sorted list. For 1, 1, 1, 2, 50 the median is 1 and the mean is 11, because the 50 pulls the mean up.
Calculators for this
Every one of these shows the working, so you can check the method as well as the answer.
More guides
https://fourfunctioncalculator.com/how-to-find-the-median/