Range and interquartile range
The range is the largest value minus the smallest. The interquartile range (IQR) is the third quartile minus the first quartile, the spread of the middle 50% of the data, and it is not affected by extreme values.
Syntax
range = max - min; IQR = Q3 - Q1| Part | What it is |
|---|---|
Q1 | the 25th percentile (first quartile) |
Q3 | the 75th percentile (third quartile) |
Examples
Data: 1, 3, 5, 7, 9, 11, 13, 15
range = 15 - 1Result: 14
Excel: =MAX(A1:A8) - MIN(A1:A8)
Same data, split in halves (textbook method)
Q1 = median of 1, 3, 5, 7 = 4
Q3 = median of 9, 11, 13, 15 = 12
IQR = 12 - 4Result: 8
Same data in Excel
=QUARTILE.INC(A1:A8, 3) - QUARTILE.INC(A1:A8, 1) = 11.5 - 4.5Result: 7 (Excel interpolates, so it differs from the halves method)
Common mistakes
- Reporting the range as two numbers (1 to 15) when a single number (14) is asked for; the statistic is the difference.
- Mixing quartile methods between groups; halves, QUARTILE.INC and QUARTILE.EXC give different Q1 and Q3 on small sets, so use one method throughout.
- Using the range to describe spread when there is an outlier; one extreme value controls it, the IQR does not.
Practice Range and interquartile range
These drills check your answer on live data, free, no account needed.
- Range of a data setThe overnight low temperatures (°C) in a lake district village over 8 nights were: -12.5, 11.5, 4.5, -0.5, -3.5, -2, -8, 0.5. What is the range? Round to 1 decimal place.
Questions
What is the IQR used for?
Describing spread robustly, drawing the box in a box plot, and flagging outliers: values below Q1 - 1.5 * IQR or above Q3 + 1.5 * IQR are the usual outlier candidates.
What is the difference between QUARTILE.INC and QUARTILE.EXC?
QUARTILE.INC uses the position (n - 1) * p + 1 and can return the min and max; QUARTILE.EXC uses (n + 1) * p and errors for quartiles that fall outside the data. INC matches most textbooks and older Excel.
Related
- PercentileHow to find a percentile of a data set and the percentile rank of one value, with exact worked examples, Excel PERCENTILE.INC and common mix-ups.
- OutliersHow to detect outliers with the 1.5 IQR fence rule and the z-score rule, worked examples with exact fences, and what to do with outliers once found.
- Standard deviationThe standard deviation formula, sample versus population versions, a worked example with exact numbers and the Excel functions STDEV.S and STDEV.P.
- Mean, median and modeHow to calculate the mean, median and mode of a data set by hand and in Excel, when each average is the right one, and the mistakes that give a wrong answer.