Median of grouped data: the cumulative frequency check
Most wrong answers for the median of grouped data come from one slip: picking the wrong class or the wrong cf. This page builds the cumulative column first, then gives you a two-line check that catches both slips before you write the answer.
All three tables are invented for practice, with equal class widths, and are not real survey data or an exam key. Answers are rounded to two decimal places unless they come out exact.
The steps, in order
- Add a cumulative frequency (cf) column: each row is the running total of the frequencies so far. The last entry is n.
- Work out n/2. The median class is the first class whose cumulative frequency is at least n/2.
- Read off l (lower boundary of that class), cf (the running total of the class before it), f (its own frequency) and h (the class width). Median = l + (n/2 − cf)/f × h.
- Check: the answer must lie between l and l + h. Then find the n/4 and 3n/4 marks the same way; the median must sit between them.
Example 1: the busiest class is not the median class
Fifty students noted how many minutes they studied without a phone one evening. The classes are boundaries, so 10–20 means from 10 up to 20.
| Minutes | Frequency | Cumulative frequency |
|---|---|---|
| 0–10 | 6 | 6 |
| 10–20 | 14 | 20 |
| 20–30 | 9 | 29 |
| 30–40 | 11 | 40 |
| 40–50 | 10 | 50 |
The last cumulative frequency is 50, so n = 50 and n/2 = 25. The running totals pass 25 at the 20–30 row (29), so that is the median class.
l = 20, cf = 20 (the total before this class, from the 10–20 row), f = 9, h = 10.
Median = 20 + (25 − 20)/9 × 10 = 20 + 50/9 ≈ 25.56 minutes.
Check: Inside the class? 20 ≤ 25.56 ≤ 30, yes. Quarter marks: n/4 = 12.5 falls in 10–20, so Q1 = 10 + (12.5 − 6)/14 × 10 ≈ 14.64. 3n/4 = 37.5 falls in 30–40, so Q3 = 30 + (37.5 − 29)/11 × 10 ≈ 37.73. And 14.64 < 25.56 < 37.73, so the median sits between the quarter marks.
Example 2: when n/2 lands exactly on a total
Forty students were measured for height. This table is built to hit a total exactly on n/2.
| Height (cm) | Frequency | Cumulative frequency |
|---|---|---|
| 150–160 | 8 | 8 |
| 160–170 | 12 | 20 |
| 170–180 | 11 | 31 |
| 180–190 | 9 | 40 |
n = 40 and n/2 = 20. The first cumulative frequency that reaches 20 is the 20 in the 160–170 row, so that is the median class.
l = 160, cf = 8, f = 12, h = 10.
Median = 160 + (20 − 8)/12 × 10 = 160 + 10 = 170 cm.
Check: The answer is the top edge of its class, 160 ≤ 170 ≤ 170, which still counts as inside. Quarter marks: n/4 = 10 gives Q1 = 160 + (10 − 8)/12 × 10 ≈ 161.67, and 3n/4 = 30 falls in 170–180, giving Q3 = 170 + (30 − 20)/11 × 10 ≈ 179.09. So 161.67 < 170 < 179.09.
Example 3: odd n and a half-way count
Forty-five students timed themselves on a logic puzzle. With 45 students, n/2 is not a whole number, and that is fine.
| Minutes | Frequency | Cumulative frequency |
|---|---|---|
| 10–15 | 4 | 4 |
| 15–20 | 10 | 14 |
| 20–25 | 15 | 29 |
| 25–30 | 11 | 40 |
| 30–35 | 5 | 45 |
n = 45 and n/2 = 22.5. The running totals pass 22.5 at the 20–25 row (29), so that is the median class.
l = 20, cf = 14, f = 15, h = 5.
Median = 20 + (22.5 − 14)/15 × 5 = 20 + 8.5/3 ≈ 22.83 minutes.
Check: Inside the class? 20 ≤ 22.83 ≤ 25, yes. Quarter marks: n/4 = 11.25 falls in 15–20, so Q1 = 15 + (11.25 − 4)/10 × 5 = 18.625. 3n/4 = 33.75 falls in 25–30, so Q3 = 25 + (33.75 − 29)/11 × 5 ≈ 27.16. And 18.625 < 22.83 < 27.16.
Counterexample: two ways to fail the check
Go back to Example 1, where the busiest class is 10–20 (frequency 14) but the median class is 20–30. Suppose someone grabs the busiest class and plugs it into the median formula: 10 + (25 − 6)/14 × 10 ≈ 23.57. That number is outside 10–20, so the first part of the check rejects it at once.
The second slip is using the median class's own running total, 29, as cf. Then 20 + (25 − 29)/9 × 10 ≈ 15.56, which is below the class boundary 20 and again fails. In both cases the formula itself was applied correctly; the wrong class or wrong cf went in. Only the inside-the-class check shows it.
Try one yourself
A shop logged the delivery weight of 30 parcels in grams: 100–120 has 4 parcels, 120–140 has 7, 140–160 has 10, 160–180 has 6 and 180–200 has 3. Find the median and check it against the quarter marks.
Show the worked self-check
Cumulative frequencies: 4, 11, 21, 27, 30. So n = 30 and n/2 = 15, which first fits in the 140–160 row (21). l = 140, cf = 11, f = 10, h = 20. Median = 140 + (15 − 11)/10 × 20 = 148 g. Check: 140 ≤ 148 ≤ 160. Quarter marks: n/4 = 7.5 falls in 120–140, so Q1 = 120 + (7.5 − 4)/7 × 20 = 130. 3n/4 = 22.5 falls in 160–180, so Q3 = 160 + (22.5 − 21)/6 × 20 = 165. And 130 < 148 < 165.
Scope and limits
- The formula is used with equal class widths and classes written as continuous boundaries. Unequal widths, open-ended classes and gaps between classes are not covered.
- The result is an estimate. Grouping hides where inside a class the values really sit, so the formula assumes they are spread evenly.
- The mode and the mean of grouped data are separate methods and are only mentioned here to separate them from the median.
- No table here is real data, and none is taken from a textbook exercise.
Common questions
Why look for n/2 and not just the middle row?
The median is the middle observation, which is the (n/2)th one in order. The cumulative frequency column tells you which class holds it: the first class whose total reaches n/2. The middle row of the table has no special claim.
What exactly is cf in the formula?
It is the cumulative frequency of the class just before the median class, so everything already counted below l. It is not the median class's own running total, which already includes the f observations the formula takes a share of.
What if n/2 equals a cumulative frequency exactly?
Pick the first class whose total reaches n/2 and apply the formula as usual. The answer then comes out as that class's upper boundary, as in Example 2, which still counts as inside the class.
Is the class with the largest frequency the median class?
Not by rule. The largest frequency marks the modal class, which belongs to the mode. The median class comes from cumulative frequency and n/2. They can be the same class, so check the totals instead of assuming.
Sources and scope
Sources checked . They support the median formula for grouped data and the use of cumulative frequency. The tables, worked examples, quarter-mark check and self-check above are original EZT practice.
- Maths Is Fun: Mean, Median and Mode from Grouped Frequencies, for the estimated median formula with L, n, B, G and w.
- NCERT Class 10 Mathematics, Chapter 13: Statistics, for the median of grouped data and the cumulative frequency table.
Class 10 Maths Chapter 13 practiceCalculate marks as a percentage