Interquartile range (IQR) calculator
Paste your data and get the interquartile range straight away: Q3 − Q1, with both quartiles, the median and every step of the working.
- IQR
- 9
- Q1
- 18
- Q3
- 27
- Median
- 22
Separate with commas, spaces or new lines, or paste a spreadsheet column. 14 numbers read.
Textbooks and TI calculators take medians of the lower and upper halves. Excel interpolates. Results can differ on small data sets.
| Count (n) | 14 |
|---|---|
| Minimum | 12 |
| First quartile Q1 | 18 |
| Median | 22 |
| Third quartile Q3 | 27 |
| Maximum | 48 |
| Range | 36 |
| Interquartile range (IQR) | 9 |
| Lower fence Q1 − 1.5 × IQR | 4.5 |
| Upper fence Q3 + 1.5 × IQR | 40.5 |
| Outliers | 48 |
| Mean | 23.5714 |
| Standard deviation (sample) | 8.8118 |
Step by step
- Sort the 14 values: 12, 15, 17, 18, 19, 21, 22, 22, 24, 25, 27, 29, 31, 48.
- The median is the middle pair (values 7 and 8), averaged: 22.
- Q1 is the median of the lower half (12, 15, 17, 18, 19, 21, 22): 18. Q3 is the median of the upper half (22, 24, 25, 27, 29, 31, 48): 27.
- IQR = Q3 − Q1 = 27 − 18 = 9.
- Fences: 18 − 1.5 × 9 = 4.5 and 27 + 1.5 × 9 = 40.5. Values outside them are outliers: 48.
What the interquartile range measures
The interquartile range is the spread of the middle 50% of the data: IQR = Q3 − Q1. Unlike the range (max − min), one extreme value barely moves it, so it is the usual measure of spread next to the median for skewed data such as incomes, house prices or response times.
How to calculate the IQR
- Sort the values.
- Find the median and split the data into a lower and an upper half.
- Q1 is the median of the lower half; Q3 is the median of the upper half.
- Subtract: IQR = Q3 − Q1.
Example: for 2, 4, 4, 5, 7, 9, 10, 12 the lower half is 2, 4, 4, 5 (Q1 = 4) and the upper half is 7, 9, 10, 12 (Q3 = 9.5), so the IQR is 5.5.
Using the IQR to find outliers
The 1.5 × IQR rule flags any value below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. The fences are listed in the results; the outlier calculator puts them first.
When does a value become an outlier?
Ten delivery times in days. Drag the slowest one further out. It turns into a separate dot once it passes Q3 + 1.5 × IQR.
Q1 5 · median 7 · Q3 9 · IQR 4
Upper fence = Q3 + 1.5 × IQR = 9 + 1.5 × 4 = 15. 12 is inside, so the whisker reaches it.
Questions
What is the formula for the interquartile range?
IQR = Q3 − Q1, the third quartile minus the first quartile.
Is this also a quartile calculator?
Yes. It gives Q1, the median (Q2) and Q3, with a choice of the school/TI-84 method or Excel’s QUARTILE.INC.
What does a large IQR mean?
The middle half of the values is widely spread. A small IQR means they cluster tightly around the median. Compare IQRs only between data measured in the same units.
How do I calculate the IQR in Excel?
Use =QUARTILE.INC(range,3) − QUARTILE.INC(range,1). Pick the Excel method above to get the same answer here.