Percentile Calculator: Inclusive, Exclusive and Nearest-Rank Methods
By FindMySum · Last reviewed
A percentile calculator finds the value below which a given percentage of a data set falls. Paste a list of numbers, choose k, and this one returns the k-th percentile by all three methods in everyday use: Excel's inclusive PERCENTILE.INC, its exclusive PERCENTILE.EXC, and the nearest-rank method. It also gives the quartiles, the interquartile range with outlier fences, and the percentile rank of any value you enter, with every sorted value listed beside its percentile position.
What a percentile is
Sort the data from smallest to largest. The k-th percentile is the point that splits the sorted list so that about k% of the values are at or below it. The 50th percentile is the median; the 25th and 75th are the first and third quartiles. Percentiles are useful because they describe position without assuming any particular shape for the data, so one extreme value doesn't distort them the way it can distort a mean.
The difficulty is the word "about". With eleven values, there is no value with exactly 90% of the data below it, so a method has to decide which position counts as the 90th percentile and how to fill the gaps between values. Hyndman and Fan's 1996 survey found nine different rules in statistical software. Three cover nearly every case you will meet.
The three methods
Write p = k ÷ 100 and number the sorted values x₁ to xₙ. Each method computes a position h; when h falls between two whole positions, the result is interpolated linearly between the neighbouring values.
| Method | Position | Range of k | Used by |
|---|---|---|---|
| Inclusive (type 7) | h = (n − 1)p + 1 | 0 to 100 | Excel PERCENTILE.INC and QUARTILE.INC, Google Sheets, R, NumPy |
| Exclusive (type 6) | h = (n + 1)p | 100 ÷ (n + 1) to 100n ÷ (n + 1) | Excel PERCENTILE.EXC and QUARTILE.EXC, Minitab, NIST e-Handbook |
| Nearest rank | rank = ⌈p × n⌉, no interpolation | above 0 to 100 | Service-level reports, some textbooks |
The inclusive method treats the minimum as the 0th percentile and the maximum as the 100th. The exclusive method treats the data as a sample from something larger, so it places the minimum at 1/(n + 1) and the maximum at n/(n + 1); percentiles beyond those are undefined, which is the #NUM! error in Excel.
Worked example with the default data
The calculator opens with the data from Microsoft's QUARTILE.EXC help page: 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49. There are n = 11 values, already sorted, and the default asks for the 90th percentile, so p = 0.9.
- Inclusive: h = 10 × 0.9 + 1 = 10. The 10th value is 47.
- Exclusive: h = 12 × 0.9 = 10.8. That is 80% of the way from the 10th value (47) to the 11th (49): 47 + 0.8 × 2 = 48.6.
- Nearest rank: ⌈0.9 × 11⌉ = ⌈9.9⌉ = 10, so the 10th value, 47.
The quartiles show the difference more clearly. By the inclusive method Q1 = 25.5 and Q3 = 42.5; by the exclusive method Q1 = 15 and Q3 = 43, the values Microsoft's help page lists. With only eleven values the two methods disagree by more than ten units at Q1, a reminder to say which method you used when you report a percentile.
Percentile rank
Percentile rank answers the reverse question: given a value, where does it sit? The calculator uses Excel's PERCENTRANK.INC, which counts the values below it and divides by n − 1, interpolating when the value falls between two data points. For the default data, 40 has five values below it, so its rank is 5 ÷ 10 = 50%.
Two simpler measures are shown alongside: the share of values strictly below (5 of 11, about 45.5%) and the share at or below (6 of 11, about 54.5%). Their midpoint, 50%, is the mid-rank definition many textbooks use. For a value outside the data, PERCENTRANK.INC is undefined.
Excel displays PERCENTRANK.INC to three digits by truncating, not rounding, so a rank of 5/9 appears as 0.555 instead of 0.556. The calculator gives both forms, which makes it easy to match a spreadsheet.
Quartiles, IQR and outliers
The interquartile range, IQR = Q3 − Q1, measures the spread of the middle half of the data and ignores the extremes. John Tukey's box-plot rule marks a value as a possible outlier when it lies more than 1.5 × IQR below Q1 or above Q3. With the inclusive quartiles of the default data, IQR = 17 and the fences are 0 and 68, so none of the eleven values is flagged, even though 6 and 7 sit well below the rest. The calculator marks any outliers in the sorted table.
Choosing a method
If you are matching a spreadsheet, a course or a published report, use the same method it used. Without such a constraint, the inclusive method is the most widely implemented default. Use nearest rank when the answer must be an observed value, such as a response time that 95% of requests met. With hundreds of values or more, all three methods give nearly the same answer, and the choice stops mattering.
More questions
Is the median always the 50th percentile?
Yes, by the inclusive and exclusive methods both: they give the middle value for an odd count and the average of the two middle values for an even count. The nearest-rank method gives the lower of the two middle values for an even count, which is why some textbooks call that the lower median.
How are growth-chart percentiles different?
Paediatric growth charts, such as the WHO charts adapted for Canada, don't rank your child among a list you typed in. They compare a measurement with a reference population described by a fitted statistical model (the LMS method), so the percentile comes from a formula, not from sorting data.
What is a percentile in a standardised test report?
It is the percentage of the norm group, the students the test was standardised on, who scored at or below the student. It is not the percentage of questions answered correctly, and it is not evenly spaced: near the middle a few raw-score points can move a student many percentile places, while near the top the same gain moves them very little.
Can a percentile be a value that is not in my data?
With the inclusive and exclusive methods, yes: they interpolate between neighbouring values, so the 30th percentile of 1, 2, 3, 4 is 1.9. The nearest-rank method always returns one of your observations.
What is a decile or a quintile?
Other names for particular percentiles. Deciles cut the data into ten equal parts (the 10th, 20th, … 90th percentiles) and quintiles into five (20th, 40th, 60th, 80th). Income statistics often report the top decile or the bottom quintile. Enter the matching k to get them.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.