Three percentile methods
Sort the n values from smallest to largest and call them x1 … xn. Every method finds a position h in that list and, when h falls between two values, interpolates: P = x⌊h⌋ + (h − ⌊h⌋) × (x⌊h⌋+1 − x⌊h⌋).
The inclusive method (R type 7, Excel PERCENTILE.INC and Google Sheets PERCENTILE) uses h = (n − 1)p + 1, so the 0th percentile is the minimum and the 100th is the maximum. The exclusive method (R type 6, Excel PERCENTILE.EXC) uses h = (n + 1)p and is undefined for percentiles too close to 0 or 100. Nearest rank skips interpolation and takes the value at rank ⌈p × n⌉.
| Method | Position h | Also called |
|---|---|---|
| Inclusive | (n − 1)p + 1 | R-7, PERCENTILE.INC |
| Exclusive | (n + 1)p | R-6, PERCENTILE.EXC |
| Nearest rank | ⌈p × n⌉ | no interpolation |
Worked example: the 40th percentile
For the data 15, 20, 35, 40, 50 (n = 5) and p = 0.40, the inclusive position is h = 4 × 0.4 + 1 = 2.6. That is 60% of the way from x2 = 20 to x3 = 35, so P40 = 20 + 0.6 × 15 = 29.
The exclusive method gives h = 6 × 0.4 = 2.4 and P40 = 20 + 0.4 × 15 = 26, while nearest rank gives rank ⌈2⌉ = 2 and P40 = 20. On small data sets the choice matters, so match the method your course or software uses.
Percentile rank of a value
The percentile rank answers the reverse question: what share of the data lies below a value? This calculator reports the mid-rank definition (B + E/2) ÷ n × 100, where B is the count below and E the count equal. For 35 in the example above, that is (2 + 0.5) ÷ 5 = 50%.
It also shows the strict share below, the share at or below, and Excel's PERCENTRANK.INC result, which inverts the inclusive percentile method.