GUIDE 02

Quartiles, IQR and Outliers: Why Methods Give Different Values

Why Excel QUARTILE.INC, QUARTILE.EXC and Tukey's hinges differ, plus the IQR, the 1.5×IQR outlier rule and box plots.

Quartiles are the cut points that split sorted data into four equal parts. The first quartile Q1 marks the lowest 25%, the second quartile Q2 is the median, and the third quartile Q3 marks 75%. The idea is simple, but computing quartiles of the same data in Excel, R and a textbook often gives different Q1 and Q3 values. None of them is wrong. There are simply several conventions for where a position between two data points falls.

Why are there several methods?

With 10 values, the "25% point" does not land exactly on one observation. You could call it roughly the 2.5th value or the 3.25th value. The R language catalogs nine definitions (types 1 to 9). Three are in wide use.

MethodPosition formula (k-th value after sorting)Where you meet it
R type 7k = (n−1)p + 1Excel QUARTILE.INC and PERCENTILE.INC, R default, NumPy default
R type 6k = (n+1)pExcel QUARTILE.EXC and PERCENTILE.EXC, some textbooks, Minitab
Tukey's hingessplit the data at the median, then take the median of each halfexploratory data analysis, box plot textbooks, R fivenum()

If position k is not a whole number, the value is interpolated linearly between its neighbors. For k = 3.25, take the 3rd value plus 0.25 × (4th value − 3rd value). In Tukey's original definition, when n is odd the median is included in both halves.

Same data, different quartiles

Here are 10 sorted values:

2, 4, 5, 7, 8, 10, 12, 13, 15, 25

The median is the average of the 5th and 6th values, (8+10)/2 = 9, for all three methods. The differences appear in Q1 and Q3.

Type 7 (Excel QUARTILE.INC)

  • Q1 position: (10−1)×0.25 + 1 = 3.255 + 0.25×(7−5) = 5.5
  • Q3 position: (10−1)×0.75 + 1 = 7.7512 + 0.75×(13−12) = 12.75

Type 6 (Excel QUARTILE.EXC)

  • Q1 position: (10+1)×0.25 = 2.754 + 0.75×(5−4) = 4.75
  • Q3 position: (10+1)×0.75 = 8.2513 + 0.25×(15−13) = 13.5

Tukey's hinges

  • Median of the lower half 2, 4, 5, 7, 85
  • Median of the upper half 10, 12, 13, 15, 2513
MethodQ1Q3IQR
Type 7 (INC)5.512.757.25
Type 6 (EXC)4.7513.58.75
Tukey's hinges5138

Type 6 tends to give values spread slightly further toward the ends, type 7 values pulled inward, and Tukey's hinges often land in between. With hundreds of observations the differences almost vanish, but with a few dozen or fewer they can change your conclusions.

IQR and the 1.5×IQR fences

The interquartile range IQR = Q3 − Q1 is the width of the middle 50% of the data. The mean and standard deviation react strongly to extreme values, but the IQR only looks at the middle half, so it is robust.

Tukey's outlier rule is:

  • Lower fence: Q1 − 1.5 × IQR
  • Upper fence: Q3 + 1.5 × IQR
  • Values beyond the fences are flagged as potential outliers. Values beyond 3 × IQR are sometimes labeled extreme outliers.

Apply it to the maximum value, 25:

MethodLower fenceUpper fenceIs 25 an outlier?
Type 75.5 − 1.5×7.25 = −5.37512.75 + 1.5×7.25 = 23.625Yes (above 23.625)
Type 64.75 − 1.5×8.75 = −8.37513.5 + 1.5×8.75 = 26.625No
Tukey's hinges5 − 1.5×8 = −713 + 1.5×8 = 25On the fence (not beyond it)

The same value, 25, is or is not an outlier depending on the method. That is why a report should state which quartile definition was used, and why the 1.5×IQR rule is best treated as a way to pick values to double-check, not values to delete.

How to read a box plot

A box plot draws the quartiles as a picture.

  1. Box: the bottom edge is Q1 and the top edge is Q3. The box height is the IQR.
  2. Line inside the box: the median. If it sits near one edge, the distribution is skewed.
  3. Whiskers: they extend to the most extreme data point still inside the fences, not to the fence values themselves.
  4. Dots: individual points beyond the whiskers are potential outliers.

If the upper whisker is longer than the lower one and there are dots above, suspect a right-skewed distribution. This shape is common for data that cannot go below zero, such as income, time on page or waiting time.

Practical tips

  • If you need to match another tool, check which definition it uses first. When comparing with Excel users, type 7 (INC) is the safest choice.
  • Investigate an outlier before deciding what to do. Fix it if it is a data entry error (wrong unit, extra digit). If it is a genuine extreme value, keep it and report robust statistics such as the median and IQR alongside the mean.
  • Percentiles have the same issue. Any percentile, such as the 90th, depends on the choice of position formula in the same way.
  • With small samples, quartiles themselves are unstable. With about 10 values, showing every raw data point often tells more than the quartiles do.

In this site's descriptive statistics calculator you can switch the quartile method on the same data and compare Q1, Q3, the IQR and the outlier fences.

Key takeaways

  • There is no single standard definition of quartiles. Excel QUARTILE.INC matches R type 7 and QUARTILE.EXC matches R type 6.
  • For 2, 4, 5, 7, 8, 10, 12, 13, 15, 25, Q1 and Q3 are 5.5 and 12.75 (type 7), 4.75 and 13.5 (type 6), and 5 and 13 (Tukey's hinges).
  • The outlier fences are Q1 − 1.5×IQR and Q3 + 1.5×IQR, and the same value can be flagged or not depending on the method.
  • Box plot whiskers reach the most extreme data point inside the fences.
  • State your quartile definition, and treat outliers as something to check rather than delete.

→ Calculate it now: Descriptive

Updated 2026-09-23