How to Calculate Interquartile Range
Calculate the IQR and identify statistical outliers.
The Formula
IQR = Q3 - Q1The interquartile range formula uses the mathematical relationship: IQR = Q3 - Q1. Each variable in the formula represents a measurable quantity that affects the final result.
What Each Variable Means
Every value in the interquartile range formula, what it measures, and the value used in the worked example on this page:
| Variable | Type | Example value |
|---|---|---|
| Q1 (25th percentile) | Input (you provide) | 25 |
| Q3 (75th percentile) | Input (you provide) | 75 |
| IQR | Result (calculated) | — |
| Lower Fence | Result (calculated) | — |
| Upper Fence | Result (calculated) | — |
| Midpoint (Q2 estimate) | Result (calculated) | — |
Step-by-Step Method
- 1Write down the values you know: Q1 (25th percentile), Q3 (75th percentile).
- 2Substitute your known values into the formula: IQR = Q3 - Q1.
- 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
- 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
- 5Verify your answer with the interactive Interquartile Range Calculator — it solves the same formula instantly.
Worked Example
Take a concrete case: q1 (25th percentile) = 10, with the other inputs at the typical values from the variables table above. Substituting into the formula gives iqr = 65.0000, lower fence = -87.5000, upper fence = 172.5000, midpoint (q2 estimate) = 42.5000. These numbers are solved by the same engine that powers the Interquartile Range calculator, so you can reproduce them exactly by entering the same inputs there.
| Q1 (25th percentile) | IQR | Lower Fence | Upper Fence | Midpoint (Q2 estimate) |
|---|---|---|---|---|
| 6 | 69.0000 | -97.5000 | 178.5000 | 40.5000 |
| 10 | 65.0000 | -87.5000 | 172.5000 | 42.5000 |
| 20 | 55.0000 | -62.5000 | 157.5000 | 47.5000 |
| 30 | 45.0000 | -37.5000 | 142.5000 | 52.5000 |
| 40 | 35.0000 | -12.5000 | 127.5000 | 57.5000 |
| 50 | 25.0000 | 12.5000 | 112.5000 | 62.5000 |
| 60 | 15.0000 | 37.5000 | 97.5000 | 67.5000 |
| 80 | -5.0000 | 87.5000 | 67.5000 | 77.5000 |
| 100 | -25.0000 | 137.5000 | 37.5000 | 87.5000 |
How each result changes as q1 (25th percentile) changes, holding the other inputs constant.
Practice Problems
1. Q1=25, Q3=75: With Q1 (25th percentile) 25, Q3 (75th percentile) 75, what are the results?
Answer: With Q1 (25th percentile) 25, Q3 (75th percentile) 75, the results are IQR 50.0000, Lower Fence -50.0000, Upper Fence 150.0000, Midpoint (Q2 estimate) 50.0000.
2. Q1 (25th percentile) 12.5, Q3 (75th percentile) 40 — work it out, then check the answer.
Answer: Entering Q1 (25th percentile) 12.5, Q3 (75th percentile) 40 gives IQR 27.5000, Lower Fence -28.7500, Upper Fence 81.2500, Midpoint (Q2 estimate) 26.2500.
Frequently Asked Questions
What is the formula for interquartile range?
The formula is: IQR = Q3 - Q1. Calculate the IQR and identify statistical outliers.
What values do I need to calculate interquartile range?
You need q1 (25th percentile), q3 (75th percentile). The calculator produces iqr, lower fence, upper fence, midpoint (q2 estimate) from those inputs.
What is the interquartile range when q1 (25th percentile) is 10?
With q1 (25th percentile) = 10, the result is iqr = 65.0000, lower fence = -87.5000, upper fence = 172.5000, midpoint (q2 estimate) = 42.5000. This is worked through in full in the example on this page.
Related Topics
Use the Interactive Calculator
Skip the manual math — get instant results with our free Interquartile Range calculator.
