Written and maintained by CASRAI Editorial Board
Last updated
A quartile is a special percentile: the first quartile (Q1) is the 25th percentile, the second quartile (Q2) is the 50th percentile (the median), and the third quartile (Q3) is the 75th percentile. Percentiles cut ordered data into hundredths; quartiles cut it into quarters. The part most explainers skip is that the numeric answer depends on the calculation method, so the same eight numbers give different quartiles in Excel and in SPSS. This page shows both answers with the arithmetic.
Definition: what is a percentile and what is a quartile?
The NIST/SEMATECH e-Handbook of Statistical Methods says percentiles split a set of ordered data into hundredths, and that the pth percentile is a value Y(p) such that at most (100p)% of the measurements are less than it. Deciles split the data into tenths, and the 50th percentile is the median. Quartiles are the three cut points that split ordered data into four groups: Microsoft’s documentation for the Excel QUARTILE.INC function lists quart 1 as the first quartile (25th percentile), quart 2 as the median (50th percentile) and quart 3 as the third quartile (75th percentile).
How are quartiles and percentiles related?
Every quartile is a percentile, but most percentiles are not quartiles. The relationship is a fixed mapping:
| Quartile | Percentile | Share of data at or below (approx.) |
|---|---|---|
| Q1 (first or lower quartile) | 25th percentile (P25) | one quarter |
| Q2 (second quartile, the median) | 50th percentile (P50) | one half |
| Q3 (third or upper quartile) | 75th percentile (P75) | three quarters |
Excel adds two end points to its quartile function: quart 0 returns the minimum and quart 4 the maximum. The distance Q3 minus Q1 is the interquartile range, covered in the interquartile range and five-number summary guide.
Quartile and percentile: three things people mix up
The words are used for three different objects, and keeping them apart avoids most confusion.
| Term | What it is | Example reading |
|---|---|---|
| Percentile value (cut point) | A score on the original scale below which a stated share of the data falls | “The 75th percentile is 15.75” |
| Percentile rank | The reverse conversion: a score turned into a percentage | “A score of 12 sits above half of the values” |
| Quartile group (band) | The quarter of observations between two cut points | “This case is in the top quartile” |
A percentile converts a percentage into a score; a percentile rank converts a score into a percentage. The second direction is worked through in how to calculate a percentile from a rank. Journal “Q1 to Q4” labels are a rank-based grouping inside a subject category and are a separate topic: see journal impact factor and quartile rankings.
Percentile and quartile formula (the position rule)
There is no single universal formula. Sort the data from smallest to largest, find a position, then interpolate between the two neighbouring values. Two common position rules are:
- Type 6 (NIST default): position = p(N + 1). Write it as k + d, where k is the whole-number part and d the fractional part (d is at least 0 and below 1).
- Type 7 (Excel INC functions and R’s default): position = 1 + p(N − 1), again written as k + d.
In both cases, for k from 1 to N − 1, the estimate is Y(p) = Y[k] + d × (Y[k+1] − Y[k]). If k = 0 the estimate is the smallest value, and if k is N or more it is the largest. Symbols: p is the proportion (0.25 for Q1, 0.50 for the median, 0.75 for Q3), N is the number of observations, Y[k] is the kth smallest value, and d is the interpolation fraction. NIST notes that Excel and R’s default use the 1 + p(N − 1) rule (its method R7), and R’s documentation says quantile() uses type 7 by default. R’s documentation of quantile() describes type 6 as the rule Minitab and SPSS use and notes that Hyndman and Fan (1996) recommended type 8.
Worked example: quartiles and percentiles from eight values
Sorted data (N = 8): 2, 4, 7, 9, 12, 15, 18, 21.
Median (Q2, P50). N is even, so average the middle pair: (9 + 12) / 2 = 10.5. Both rules agree: type 7 position = 1 + 0.5 × 7 = 4.5, and type 6 position = 0.5 × 9 = 4.5.
Type 7 (Excel QUARTILE.INC, R default).
- Q1: position = 1 + 0.25 × 7 = 2.75, so k = 2, d = 0.75. Q1 = 4 + 0.75 × (7 − 4) = 4 + 2.25 = 6.25.
- Q3: position = 1 + 0.75 × 7 = 6.25, so k = 6, d = 0.25. Q3 = 15 + 0.25 × (18 − 15) = 15 + 0.75 = 15.75.
- IQR = 15.75 − 6.25 = 9.5.
Type 6 (NIST default; SPSS and Minitab per the R documentation).
- Q1: position = 0.25 × 9 = 2.25, so k = 2, d = 0.25. Q1 = 4 + 0.25 × 3 = 4.75.
- Q3: position = 0.75 × 9 = 6.75, so k = 6, d = 0.75. Q3 = 15 + 0.75 × 3 = 17.25.
- IQR = 17.25 − 4.75 = 12.5.
Same data, two defensible answers: Q1 is 6.25 or 4.75, and the IQR is 9.5 or 12.5. Neither is an error. The difference is the position rule, and it shrinks as the sample grows.
Interpretation: how to read a quartile or percentile
| Result (type 7 example) | Reading |
|---|---|
| Q1 = 6.25 | Two of the eight values (2 and 4) fall below 6.25, which is one quarter of the data. |
| Median = 10.5 | Four values fall below and four above. |
| Q3 = 15.75 | Six of the eight values fall below 15.75, which is three quarters of the data. |
| A case “in the top quartile” | It lies above Q3. This is a group statement, not a score. |
| IQR = 9.5 | The span of the middle half of the data; it is not affected by the largest or smallest value. |
To flag unusual values with the quartiles, see how to find an outlier in statistics; for the percentile range of a dataset, see how to find a percentile range.
Assumptions and common mistakes
- Not sorting first. Every rule works on ordered data.
- Mixing methods. Quartiles from Excel and from SPSS can differ on the same column. State which rule you used.
- Treating percentile rank as percent correct. A percentile rank of 80 means a score sits above about 80% of the comparison group, not that 80% of items were answered correctly.
- Confusing a quartile cut point with a quartile group. “Q1 = 6.25” is a value; “in the first quartile” is membership of the lowest quarter.
- Percentile range is not the IQR. The IQR is one particular range (P75 minus P25).
- Tiny samples. With eight values, interpolated percentiles are mostly a convention, not a measurement of a population.
How to report quartiles and percentiles (APA-style example)
A common way to report the example data is the median with the first and third quartiles, plus the rule used:
Scores had a median of 10.5 (Q1 = 6.25, Q3 = 15.75; quartiles computed with linear interpolation, R type 7).
or, with the interquartile range, Mdn = 10.5, IQR = 9.5. Report the same decimal places for every statistic and name the software and version, because the rule is a software default. For the wider set of summary measures, see descriptive statistics.
How to calculate quartiles and percentiles in Excel, R or Python
Excel
With the eight values in A1:A8 (Microsoft documents QUARTILE.INC(array, quart) and PERCENTILE.INC(array, k), with k from 0 to 1):
=QUARTILE.INC(A1:A8, 1) → 6.25
=PERCENTILE.INC(A1:A8, 0.25) → 6.25
=QUARTILE.INC(A1:A8, 3) → 15.75
Microsoft notes that QUARTILE.INC returns #NUM! for an empty array or a quart below 0 or above 4, and that a non-integer quart is truncated. PERCENTILE.INC returns #NUM! when k is below 0 or above 1.
R
x = c(2, 4, 7, 9, 12, 15, 18, 21)
quantile(x, c(0.25, 0.5, 0.75)) # type 7 default: 6.25 10.50 15.75
quantile(x, c(0.25, 0.5, 0.75), type = 6) # 4.75 10.50 17.25
Python
import numpy as np
x = [2, 4, 7, 9, 12, 15, 18, 21]
np.percentile(x, [25, 50, 75]) # [ 6.25 10.5 15.75]
np.percentile(x, [25, 75], method='weibull') # [ 4.75 17.25]
Both Python lines were run with NumPy 2.5.1 and give the values shown; the default linear method matches R’s type 7 and the weibull method matches type 6 on this data.
FAQ
Is a quartile the same as a percentile?
Not exactly. A quartile is a particular percentile: Q1 is the 25th, Q2 the 50th and Q3 the 75th. Percentiles also include every other cut between 1 and 99.
Is the 50th percentile the median?
Yes. NIST states that the 50th percentile is called the median, and it is also the second quartile.
Why do Excel and SPSS give different quartiles?
They use different position rules. Excel’s INC functions and R’s default use 1 + p(N − 1); SPSS and Minitab use p(N + 1), according to R’s documentation. The gap shrinks as N grows.
What does “top quartile” mean?
It means above the third quartile, in the highest quarter of the group. It is a ranking statement about a group, not a score.
Is the interquartile range the same as the percentile range?
The IQR is the range from the 25th to the 75th percentile. A percentile range can be any pair of percentiles. See median and interquartile range.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, section 7.2.6.2 Percentiles, itl.nist.gov/div898/handbook/prc/section2/prc262.htm (checked 2026-10-29).
- Microsoft Support, QUARTILE.INC function, support.microsoft.com (checked 2026-10-29).
- Microsoft Support, PERCENTILE.INC function, support.microsoft.com (checked 2026-10-29).
- R Documentation, quantile() in package stats, stat.ethz.ch/R-manual (checked 2026-10-29).
- Hyndman, R. J., & Fan, Y. (1996). Sample quantiles in statistical packages. The American Statistician, 50(4), 361-365, as cited in the R quantile() documentation above.








