How to Find Quartiles from a Histogram (Grouped Data)
At a glance
- 1. Read the frequencies
Take each bar height. If bars have different widths, use frequency density × width.
- 2. Build cumulative totals
Keep a running total of the frequencies. The last value is the total N.
- 3. Find the positions
Q1, the median and Q3 sit at positions N/4, N/2 and 3N/4.
- 4. Locate the class
Find the first bar whose cumulative total reaches each position.
- 5. Interpolate inside it
Apply Q = L + ((pN − F) / f) × w with that bar's lower bound, width and counts.
Try it: Quartiles calculator
A histogram doesn’t show the individual data values, only how many fall into each class (bar). So you can’t sort the data and pick the middle values. Instead, you estimate the quartiles by assuming the values inside each bar are spread evenly across its width. That is the standard method for grouped data, and it is what exam boards and textbooks expect.
The formula
For the quartile at proportion ( for Q1, for the median, for Q3):
where
- is the total frequency (the sum of all bar heights),
- is the lower boundary of the class that contains position ,
- is the cumulative frequency before that class,
- is the frequency of that class,
- is the class width.
The fraction says how far into the bar you need to go, and multiplying by turns that into a distance along the x-axis.
Step by step
- Read the frequencies off the histogram. If the bars have different widths, frequency = bar area (frequency density × width), not bar height.
- Build a cumulative frequency column: a running total of the frequencies.
- Find the positions , and .
- Locate each class: the first class whose cumulative frequency reaches or passes the position.
- Apply the formula inside that class.
Worked example
A histogram of test scores has these bars:
| Score | Frequency | Cumulative frequency |
|---|---|---|
| 0–10 | 5 | 5 |
| 10–20 | 13 | 18 |
| 20–30 | 15 | 33 |
| 30–40 | 12 | 45 |
| 40–50 | 5 | 50 |
So .
Q1. Position . The cumulative frequency passes 12.5 in the 10–20 class (it goes from 5 to 18). So , , , :
Median. Position , which falls in 20–30 (cumulative 18 → 33):
Q3. Position , which falls in 30–40 (cumulative 33 → 45):
Interquartile range: .
You can check all three values with the calculator above (switch the input type to Histogram bins).
The graphical method: cumulative frequency curve
The formula is the algebraic version of a graph you may be asked to draw:
- Plot cumulative frequency against the upper class boundary: (10, 5), (20, 18), (30, 33), (40, 45), (50, 50), starting from (0, 0).
- Join the points with straight lines (or a smooth curve, if your course asks for one).
- Go across from , and on the y-axis to the curve, then down to read the quartiles off the x-axis.
With straight lines between the points you get exactly the values from the formula. A smooth curve gives values that are close but not identical.
Common mistakes
- Using bar height when widths differ. If the y-axis says frequency density, multiply by the width to get the frequency.
- Plotting at midpoints. A cumulative frequency is the count up to the end of a class, so plot it at the upper boundary.
- Mixing up and . For grouped data, is the usual convention. belongs to some raw-data methods. For large the difference is negligible, but follow your syllabus.
- Forgetting the result is an estimate. The true quartiles of the raw data could be anywhere inside the class. The formula assumes the values are spread evenly.
Practice
Heights (cm): 150–155: 4, 155–160: 10, 160–165: 18, 165–170: 12, 170–175: 6.
Show answers
. Q1 ≈ 155 + (12.5 − 4)/10 × 5 = 159.25; median ≈ 160 + (25 − 14)/18 × 5 ≈ 163.06; Q3 ≈ 165 + (37.5 − 32)/12 × 5 ≈ 167.29; IQR ≈ 8.04.
References
- Hyndman, R. J. & Fan, Y. (1996). Sample quantiles in statistical packages. The American Statistician, 50(4), 361–365.
- NIST/SEMATECH e-Handbook of Statistical Methods – Percentiles
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.