How to Find Quartiles and the IQR

Find Q1, Q2 and Q3 by hand, calculate the IQR, and see why calculators, TI-84s and Excel sometimes give different quartiles for the same data set.

Quartiles and Interquartile Range (IQR)

You sorted your data. You found the median. But your TI-84 says Q1 is 14, your classmate's Excel says 13.5, and the answer key says 13. You are not wrong. Three different quartile methods are in common use, and they disagree most when you have a small data set. Learning how to find quartiles by the median-of-halves method lets you understand any of them, and tell the difference between a mistake and a method choice. Walk through the calculation, see why tools disagree, and get the one method that will match your textbook.

Quartiles By The Median-Of-Halves Method

The median-of-halves method is the one taught in most high-school AP Statistics courses and used by the TI-84 Plus for 1-Var Stats. You split the sorted data into two halves at the median, then take the median of each half. Those two medians are Q1 and Q3.

Step 1: Sort The Data

Write every value in increasing order. The median is the middle value. For an odd n, the median is a single data point. For an even n, the median is the average of the two middle values.

Step 2: Identify The Lower And Upper Halves

Include the overall median in both halves when n is odd. The TI-84 Plus guidebook (2010) specifies this rule: for an odd-count data set, the median is part of the lower half when you find Q1 and part of the upper half when you find Q3. For an even n, split the data into two equal halves at the median; the median itself is not a data point in either half.

Step 3: Find The Median Of Each Half

The median of the lower half is Q1. The median of the upper half is Q3. The interquartile range (IQR) is Q3 minus Q1.

Worked example (odd n): Data set: 4, 7, 9, 12, 15, 18, 21 (n=7). The overall median is 12 (4th value). Lower half including the median: 4, 7, 9, 12. Median of lower half = (7+9)/2 = 8.0. That is Q1. Upper half including the median: 12, 15, 18, 21. Median of upper half = (15+18)/2 = 16.5. That is Q3. IQR = 16.5 − 8.0 = 8.5.

Worked example (even n): Data set: 3, 6, 8, 11, 14, 17 (n=6). The overall median is (8+11)/2 = 9.5. Split at that point: lower half = 3, 6, 8. Upper half = 11, 14, 17. Q1 = median of lower half = 6. Q3 = median of upper half = 14. IQR = 14 − 6 = 8.

Odd vs Even n: Why The Rule Matters

The difference between odd and even sample sizes causes the most confusion in quartile calculation. With an odd n, the median is an actual data point. Whether you include that point in both halves (TI-84 method) or exclude it from both halves (some textbook methods) changes Q1 and Q3.

Take the odd-n data set from above: 4, 7, 9, 12, 15, 18, 21.

  • TI-84 method (median included in both halves): Q1 = 8.0, Q3 = 16.5, IQR = 8.5.
  • Exclusion method (median removed from both halves): Lower half = 4, 7, 9. Median of lower half = 7. Upper half = 15, 18, 21. Median of upper half = 18. IQR = 18 − 7 = 11.

The IQR changes by 2.5 points, nearly 30 percent, on a seven-value data set. The difference shrinks as n grows, but for small data sets (n under 20) it is large enough to flag a point as an outlier under the 1.5*IQR rule or not.

For even n, the two methods agree: the median splits the data into two equal groups, and neither half contains the median. That is why calculators and textbooks match for even n but diverge for odd n.

IQR and Range: Two Measures Of Spread

Range and interquartile range both measure spread, but they answer different questions. Range is maximum minus minimum. It is simple, entirely driven by the two most extreme values, and useless for skewed data. IQR is Q3 minus Q1. It captures the spread of the middle 50 percent of the data and ignores extremes.

For the data set 4, 7, 9, 12, 15, 18, 21, the range is 21 − 4 = 17. The IQR (using the median-of-halves method) is 8.5. Add a single outlier, say, 100, and the range jumps to 96, while the IQR stays at 8.5. That robustness to outliers makes IQR the preferred spread measure for skewed distributions, where the mean median mode comparison would show a large gap between the mean and median.

When you report descriptive statistics, pair the median with the IQR for skewed data and the mean with the standard deviation for symmetric data. The five-number summary (minimum, Q1, median, Q3, maximum) gives you both range and IQR in one snapshot.

Why Tools Disagree: Quartile Methods Compared

There is no single standard method for calculating quartiles. Hyndman and Fan (1996), in The American Statistician, documented eight sample quantile definitions (R1 through R8). Two of those, R6 and R7, are the most commonly implemented in software. A ninth method, the median-based Tukey hinge used by Texas Instruments, is the one you learned above.

The table below compares the three methods you are most likely to encounter on the same data set: 3, 6, 8, 11, 14, 17.

Quartile Method Comparison on Data Set 3, 6, 8, 11, 14, 17
MethodQ1MedianQ3IQR
TI-84 (Tukey hinge, median in both halves for odd n)69.5148
Excel QUARTILE.INC (Hyndman & Fan R7)6.259.513.757.5
Excel QUARTILE.EXC (Hyndman & Fan R6)5.59.514.59.0

Why Tools Disagree: Methods Compared On One Data Set

The table above uses an even-n data set, so the TI-84 and the two Excel methods all agree on the median (9.5). But Q1 and Q3 differ by up to 0.75 points each, and the IQR ranges from 7.5 to 9.0, a 20 percent spread.

For an odd-n data set, the disagreement is larger. Using the earlier example 4, 7, 9, 12, 15, 18, 21:

  • TI-84 (Tukey hinge): Q1 = 8.0, Q3 = 16.5, IQR = 8.5.
  • Excel QUARTILE.INC (R7): Q1 = 7.5, Q3 = 16.5, IQR = 9.0.
  • Excel QUARTILE.EXC (R6): Q1 = 7.0, Q3 = 18.0, IQR = 11.0.

Microsoft Support documentation confirms that QUARTILE.INC uses the R7 method (linear interpolation at p = (k-1)/(n-1)) and QUARTILE.EXC uses R6 (linear interpolation at p = k/(n+1)). The TI-84 Plus guidebook documents the median-of-halves approach that includes the overall median in both halves when n is odd. None of these is wrong, they are different conventions. If your textbook or exam specifies a method, use that one. If you are comparing answers across tools, check which method each tool uses before concluding you made an error.

Percentiles In Brief

Quartiles are specific percentiles: Q1 is the 25th percentile, Q2 is the 50th (the median), and Q3 is the 75th. A percentile is a value below which a given percentage of data falls. The same Hyndman and Fan methods that create multiple quartile definitions also create multiple percentile definitions. When you ask a calculator for the 30th percentile, it may use R7 (Excel), R6, or another interpolation rule. The difference matters most at small sample sizes and fades as n exceeds 100. For any data set with n < 30, state which percentile method you used when reporting percentiles.

The Single Thing That Most Often Goes Wrong

The most common error when calculating quartiles is forgetting to include the overall median in both halves for an odd-n data set. That one decision changes Q1, Q3, and the IQR, which then changes whether a point is flagged as an outlier under the 1.5*IQR rule. Before you compare your answer to a calculator or a classmate, verify whether the data set has an odd or even number of points and confirm which method you are expected to use. If you are using the TI-84 Plus, it includes the median in both halves for odd n, that is the method to replicate by hand if you want your answer to match the calculator's 1-Var Stats output.

Common Questions

Why does my TI-84 give a different Q1 than Excel for the same data?

The TI-84 uses the median-of-halves (Tukey hinge) method, which includes the overall median in both the lower and upper halves when n is odd. Excel's QUARTILE.INC uses Hyndman and Fan's R7 method, which uses linear interpolation. The two methods produce different values, especially for small data sets. For the data set 4, 7, 9, 12, 15, 18, 21, the TI-84 gives Q1 = 8.0, while QUARTILE.INC gives Q1 = 7.5.

How do I calculate quartiles when n is even?

Split the sorted data into two equal halves at the median. The median of the lower half is Q1. The median of the upper half is Q3. For an even n, the overall median is the average of the two middle values and is not a data point, so neither half contains the median. The TI-84 and most textbook methods agree on this case.

Which quartile method should I use for my homework?

Use the method specified in your textbook or assignment. If none is specified, use the median-of-halves method (TI-84 method) because it is the most commonly taught in high-school AP Statistics courses. If you are using Excel, note that QUARTILE.INC uses a different method (R7) and may give a different answer than your textbook for odd n.

Can the IQR be larger than the range?

No. The IQR is Q3 minus Q1, which covers the middle 50 percent of the data. The range is maximum minus minimum, which covers all data. The IQR cannot exceed the range. If your calculation shows otherwise, you have swapped Q1 and Q3 or used an incorrect method.

What does a difference in IQR of 2 points mean for outlier detection?

The 1.5*IQR rule is a heuristic, not a statistical test. A small difference in IQR can flag or not flag a borderline point as an outlier. For a data set with n = 7, a two-point IQR difference (8.5 vs. 11.0) changes the outlier threshold by 2.25 to 3.75 points. Always report the quartile method you used alongside any outlier claims.