How to Find the Percentile of a Data Set

Quick answer: Sort the data, count the values below yours, then apply the percentile rank formula: (below + 0.5 × equal) ÷ count × 100. To find the value at a percentile instead, sort the data and use the nearest rank method or linear interpolation — this calculator does both and labels each answer.

Every percentile question starts the same way: with sorted data. Percentiles are statements about order, not about size, so the first step in how to find the percentile of a data set is always to arrange the values from smallest to largest. Only then can you count positions, and counting positions is all a percentile ever is. This percentile calculator automates the counting, but the steps below are exactly what it does, so you can reproduce any answer by hand.

Step one: paste or write out the data set and sort it. Step two: decide which direction you are travelling. If you hold a value and want its standing, you need its percentile rank. If you hold a percentile — the 90th, say — and want the value that marks it, you need a value-at-percentile method. Step three: apply the matching formula from the sections below. Step four, the one most tools skip: state the method next to the answer, because as the worked example shows, two correct methods can give two different numbers for the same question on a small data set.

What a Percentile Actually Means

Quick answer: The Pth percentile is the value at or below which about P percent of the data falls. The 50th percentile is the median, the 25th is the first quartile and the 75th is the third quartile. A percentile describes position inside a group — never a share of marks.

Percentiles were invented to answer a human question: where do I stand? A raw score of 625 on an exam means little until you know the group. If 625 sits at the 85th percentile, about 85 percent of candidates scored at or below it — suddenly the number carries meaning. Child growth charts work the same way: a baby at the 60th percentile for weight is heavier than about 60 percent of babies of the same age and sex, which is a statement about the population of babies, not about the baby alone.

Three percentiles have their own names because they quarter the data. The 25th percentile is the first quartile, Q1. The 50th percentile is the median, also called Q2. The 75th percentile is the third quartile, Q3. The gap between Q3 and Q1 — the interquartile range — holds the middle half of the data and is one of the most robust ways to describe spread, because it ignores the extremes entirely. Deciles repeat the trick in tenths, and the everyday phrase "top ten percent" is simply the 90th percentile and above, said in plain words.

Notice what a percentile never does: it never tells you the size of the gaps. The distance between the 50th and 60th percentile might be two marks on one exam and twenty on another. Percentiles compress a distribution into ranks, which makes them excellent for comparison and useless for measuring how much better one value is than another. For gaps and spread in the original units, you want the mean and standard deviation alongside — which is why this page reports them in the same summary.

The Percentile Rank Formula

Quick answer: Percentile rank = (B + 0.5 × E) ÷ N × 100, where B counts values below yours, E counts values equal to yours and N is the total count. For 15 in 4, 8, 15, 16, 23, 42: (2 + 0.5 × 1) ÷ 6 × 100 = 41.67.

The percentile rank formula has to answer an awkward question: where does a value stand relative to itself? If ten values sit below yours and none equals it, the rank is easy. But your own value is in the data set, and counting it fully as "below you" would flatter you, while ignoring it would understate you. The mean-rank convention splits the difference: every value equal to yours — including yours — counts as half below. That is the formula this calculator uses, and it is the convention behind most rank-based statistics.

Written out: PR = (B + 0.5E) / N × 100. B is the count of values strictly below yours, E is the count of values equal to yours, and N is the size of the data set. The formula has two honest consequences worth knowing. First, no value in a finite set ever scores exactly 0 or exactly 100: the smallest value in a set of six scores (0 + 0.5) / 6 × 100 = 8.33, because it stands above half of itself. Second, ties pull ranks toward the middle, which is the fair outcome when several values are genuinely indistinguishable.

Not every textbook uses this formula. A common alternative, PR = (B + E) / N × 100, counts equals fully and would give the value 15 in the worked example a rank of 50 instead of 41.67. Another school tradition defines the percentile of a value as the percentage strictly below it. None of these is a mistake; they are different published conventions, and the honest response is the one this page takes: name the formula, show the counts, and let the reader match the convention their course or employer uses.

Worked Example: 4, 8, 15, 16, 23, 42

Quick answer: For the sorted set 4, 8, 15, 16, 23, 42: the percentile rank of 15 is 41.67; the 90th percentile is 42 by nearest rank and 32.5 by linear interpolation; the median (50th percentile, linear) is 15.5; the mean is 18, the minimum 4 and the maximum 42.

The calculator opens with this data set precisely so that every headline number can be checked with pencil and paper. The count is 6. The sum is 4 + 8 + 15 + 16 + 23 + 42 = 108, so the mean is 108 ÷ 6 = 18. The minimum is 4 and the maximum is 42. Already the summary teaches something: the mean (18) sits above the median (15.5) because the large value 42 pulls it upward, while the median, a percentile, ignores the size of that pull entirely.

Rank of 15: two values (4 and 8) fall below it, one value equals it, so PR = (2 + 0.5 × 1) ÷ 6 × 100 = 2.5 ÷ 6 × 100 = 41.67. The 90th percentile by nearest rank: the rank position is the ceiling of 0.9 × 6 = the ceiling of 5.4, which is 6, and the 6th sorted value is 42. The 90th percentile by linear interpolation: the position is 0.9 × (6 − 1) = 4.5 on a zero-based index, halfway between the 5th value (23) and the 6th value (42), giving 23 + 0.5 × (42 − 23) = 32.5. The median by linear interpolation: position 0.5 × 5 = 2.5, halfway between 15 and 16, giving 15.5 — the same answer as the school rule of averaging the two middle values, which is no coincidence: that rule is linear interpolation at the 50th percentile.

Why is the 90th percentile both 42 and 32.5?
Because the two standard methods answer slightly different questions. Nearest rank asks "which observed value marks the point where 90 percent of the data is at or below?" — the 6th value, 42. Linear interpolation asks "where on a smooth scale through the data does the 90 percent point fall?" — halfway between 23 and 42, at 32.5. On a data set of thousands the two answers nearly coincide; on six values they cannot.

The Nearest Rank Method

Quick answer: Nearest rank: sort the data, compute k = ceiling of P/100 × N, and take the k-th value. The answer is always a value that actually appears in your data set, which is why the NIST handbook and most school textbooks teach this method first.

The nearest rank method is the oldest and most literal way to find a percentile: it insists that a percentile of a data set should be one of the data. To find the Pth percentile of N sorted values, compute k = ⌈P/100 × N⌉ — the smallest whole rank whose cumulative share reaches P percent — and report the k-th value. For the 25th percentile of the worked example, k = ⌈0.25 × 6⌉ = ⌈1.5⌉ = 2, so Q1 by this method is the 2nd value, 8. For the 75th, k = ⌈4.5⌉ = 5, giving 23.

The method's strength is its plainness: no invented values, no fractions of gaps, nothing to explain beyond counting. Its weakness shows on small sets, where it moves in coarse jumps — the 80th, 85th and 90th percentiles of a six-value set can all be the same number, because there are only six candidates. Exam boards and official statistics often accept that coarseness as the price of reporting real observed values; software usually does not, which brings us to the alternative.

Linear Interpolation

Quick answer: Linear interpolation: compute the position h = P/100 × (N − 1) in the sorted data (zero-based) and blend the two neighbouring values in proportion. It is the method in Excel's PERCENTILE.INC, NumPy's default and most statistics software.

Linear interpolation treats the sorted data as points on a smooth ramp. The minimum sits at the 0th percentile, the maximum at the 100th, and the remaining values are spaced evenly between. The position of the Pth percentile is h = (P/100) × (N − 1); when h lands between two values, the answer is the weighted blend of them — exactly the calculation that produced 32.5 for the 90th percentile and 15.5 for the median in the worked example.

Because it can return values between observations, interpolation behaves gracefully on small data sets and matches what most software reports, which is why matching a spreadsheet answer usually means matching this method. Its honest cost is the mirror of nearest rank's virtue: the answer may be a number nobody observed — no baby weighed exactly the interpolated figure — so for reporting an actual case or score, nearest rank is often the more truthful choice. This calculator refuses to choose for you: both columns are printed, labelled, every time.

Percentile vs Percentage

Quick answer: A percentage is a share of one whole — 80 percent means 80 of 100 marks, regardless of anyone else. A percentile is a position in a group — the 80th percentile means about 80 percent of the group scored at or below you. Percentile vs percentage is the most common confusion in this topic.

The two words differ by a suffix and by an entire idea. A percentage compares a part to its own whole: questions answered correctly out of questions asked. It needs no one else in the room. A percentile compares a value to a population: it is undefined until a group exists. A student can score 55 percent on a brutally hard exam and stand at the 97th percentile, or score 92 percent on an easy one and stand at the 60th. Both statements can be true of the same paper.

The confusion does real damage in both directions. Parents hear "70th percentile" for a child's height and worry the child is "only 70 percent grown"; a candidate hears "top 10 percent" and assumes a score above 90 percent. Whenever you meet a percentile, translate it aloud as "out of every hundred people in the group, about this many are at or below" — the sentence forces the group back into the meaning, where it belongs.

Percentile Reference Table

For the worked-example data set 4, 8, 15, 16, 23, 42, here are the landmark percentiles under both methods, together with the percentile rank of every value in the set. Use the table to see at a glance where the methods agree — at the minimum, the maximum and, nearly, the quartiles of larger sets — and where small data makes them part company.

PercentileNearest rankLinear interpolation
0th (minimum)44
25th (Q1)89.75
50th (median)1515.5
75th (Q3)2321.25
90th4232.5
100th (maximum)4242
ValueBelowPercentile rank
408.33
8125.00
15241.67
16358.33
23475.00
42591.67

Read the second table row by row and the mean-rank formula becomes visible: each step up the sorted list adds 100 ÷ 6 ≈ 16.67 points, and each value sits half a step above the count strictly below it. That regular ladder is exactly what a percentile rank is — a rescaled rank, nothing more mysterious.

Percentiles in Excel, Sheets and Code

Software is where method differences stop being academic. Excel and Google Sheets offer PERCENTILE.INC, which is linear interpolation on the (N − 1) position rule used here, and PERCENTILE.EXC, which uses an (N + 1) rule and refuses percentiles that would fall outside the observed range. PERCENTRANK.INC returns the rank of a value as a fraction using interpolation between neighbouring ranks — close to, but not identical with, the mean-rank formula on this page when duplicates are present. Python's NumPy defaults to linear interpolation in numpy.percentile; R's quantile function offers nine numbered types, of which type 7 is the linear method and type 1 is closest to nearest rank.

The practical rule: when two tools disagree about a percentile, do not ask which is broken — ask which definition each one implements, then pick the definition your textbook, exam board or report specification names. If it names none, linear interpolation is the safest default for analysis, and nearest rank the safest for reporting a value that a real case actually attained.

Common Mistakes

The first mistake is the percentile vs percentage swap covered above. The second is averaging percentiles: the mean of the 90th percentile of two classes is not the 90th percentile of the combined class, because percentiles are ranks, and ranks do not average. Pool the raw data and recalculate. The third is quoting a percentile without its reference group — "the 90th percentile" of a school, a country and an age band are three different claims wearing one costume.

Fourth: trusting a percentile from a tiny sample. With six values, the ladder of possible ranks has only six rungs, and the difference between methods can be a third of the data's range, as the 90th percentile here swings between 32.5 and 42. Fifth: assuming the 100th percentile means perfection or the 0th means zero — under rank conventions neither endpoint is even reachable, and under interpolation they are simply the maximum and minimum wearing formal dress.

Honest Limits: Definitions Differ

This page states its methods rather than hiding them, and the limit follows directly: there is no single correct percentile for a finite data set, only standard ones. Hyndman and Fan catalogued nine definitions in common use in their well-known paper on sample quantiles, and every statistics package implements several. The numbers here — mean-rank for ranks, nearest rank and linear interpolation for values — cover the conventions used by the NIST handbook, school textbooks and mainstream software, but a course or board using another convention will expect its own answers.

Two further limits deserve plain words. A percentile says nothing about distance: equal percentile gaps are not equal value gaps. And a percentile is only as meaningful as its data set — ranks computed on stale, biased or tiny samples inherit every one of those flaws, neatly formatted. Use percentiles to locate a value inside a group you trust, state the method beside the number, and reach for the mean, median and spread alongside whenever the size of a difference matters.

Sources and References

Verification note: six of these seven sources returned HTTP 200 to a direct check before publication. The Penn State STAT 200 page could not be reached by that automated check, so it was verified instead by full content retrieval of the lesson page itself, which confirms the lesson covers percentiles and the five-number summary. No source was substituted: all seven are the references this guide was written against.