Excel guide · 6 min read
How to calculate percentiles and quartiles in Excel
=PERCENTILE.INC(B2:B13,0.9) to get the 90th percentile, the value that 90% of the data sits at or below, which is also the cutoff for the top 10%. Use =QUARTILE.INC(B2:B13,1) for the first quartile and 3 for the third. To go the other way and ask what percentile one value is at, use =PERCENTRANK.INC(B2:B13,B5).Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | |
|---|---|---|
| 1 | Rep | Q3 sales ($) |
| 2 | Ana | 18400 |
| 3 | Ben | 22150 |
| 4 | Chen | 15900 |
| 5 | Dina | 31200 |
| 6 | Eli | 19750 |
| 7 | Farah | 24800 |
| 8 | Gus | 27300 |
| 9 | Hana | 16850 |
| 10 | Ivan | 21400 |
| 11 | Jade | 38900 |
| 12 | Kofi | 21400 |
| 13 | Lena | 25900 |
Download this sheet as an Excel practice file (.xlsx)
The top 10% cutoff with PERCENTILE.INC
The sales manager wants to know what it takes to be in the top 10% of reps this quarter. That is the 90th percentile: =PERCENTILE.INC(B2:B13,0.9). The second argument is a fraction between 0 and 1, so type 0.9 or 90%, not 90. Typing 90 returns #NUM!.
A percentile is usually not one of your numbers. Excel sorts the values, works out a position of (n - 1) x k + 1, and if that position falls between two values it takes the right share of the gap between them. With 12 reps the position is 11 x 0.9 + 1 = 10.9, so the answer sits 90% of the way from the 10th smallest value (27,300) to the 11th (31,200). The formula below does exactly that with SMALL, so you can see where the number comes from; in Excel, PERCENTILE.INC gives the same result in one step.
Result: 30810
30,810: a rep needs about $30,810 in Q3 sales to be in the top 10%. No rep sold exactly that; it is 90% of the way between Gus (27,300) and Dina (31,200).
Who is in the top 10%, and why it is not 1.2 people
Count the reps at or above the cutoff with COUNTIF. In Excel you would write =COUNTIF(B2:B13,">="&PERCENTILE.INC(B2:B13,0.9)). Here the SMALL version stands in for PERCENTILE.INC.
10% of 12 reps is 1.2 people, which cannot happen, so the count will never match the percentage exactly on small lists. Decide what you really mean. If the rule is "the top 10% by value", use the percentile. If it is "the best 2 reps", use =LARGE(B2:B13,2) as the cutoff instead, which always returns a real sales figure and a fixed head count.
Result: 2
2: Dina and Jade are at or above the cutoff, which is 2 of 12 reps, about 17%, not exactly 10%.
PERCENTILE.INC or PERCENTILE.EXC?
PERCENTILE.INC includes the ends: k can be anything from 0 to 1, and 0 returns the minimum, 1 the maximum. PERCENTILE.EXC excludes them. It uses the position (n + 1) x k, so the result spreads a little wider, and it returns #NUM! if k is too close to 0 or 1 for the amount of data. With 12 values, k must be between 1/13 and 12/13 (about 0.077 to 0.923), so =PERCENTILE.EXC(B2:B13,0.95) is #NUM! here.
For the 90th percentile, EXC uses position 13 x 0.9 = 11.7, which is 70% of the way from the 11th value to the 12th. The formula below writes that out. The gap between the two methods is large here because Jade's 38,900 sits far above everyone else; with hundreds of values the two give almost the same answer.
Pick INC unless you have a reason not to. It is what the older PERCENTILE function does, it works for any k, and it is what most spreadsheets and people expect. Use EXC only when a textbook, a standard or a colleague's analysis specifies the exclusive method, and then use it everywhere so your numbers match.
Result: 36590
36,590: the exclusive 90th percentile, compared with 30,810 from the inclusive method. Same data, about $5,780 apart.
Quartiles: QUARTILE.INC and the interquartile range
Quartiles are just three particular percentiles. =QUARTILE.INC(B2:B13,1) is the 25th percentile (Q1), 2 is the median, and 3 is the 75th percentile (Q3). QUARTILE.INC also accepts 0 for the minimum and 4 for the maximum. QUARTILE.EXC only accepts 1, 2 and 3 and returns #NUM! for 0 or 4.
For Q1 the inclusive position is 11 x 0.25 + 1 = 3.75, so the formula below takes 75% of the way from the 3rd smallest value to the 4th. Q3 works the same way at position 9.25: =SMALL(B2:B13,9)+0.25*(SMALL(B2:B13,10)-SMALL(B2:B13,9)), which gives 26,250. Q3 minus Q1 is the interquartile range (IQR), the spread of the middle half of the team. Unlike the range from minimum to maximum, one huge quarter from Jade barely moves it.
If you build a Box and Whisker chart (Insert > Insert Statistic Chart > Box and Whisker), Format Data Series has a Quartile Calculation setting with Inclusive median and Exclusive median. Set it to match the formulas you report, or the chart and the table will disagree.
Result: 19412.5
19,412.50: Q1. A quarter of the reps sold less than about $19,400. With Q3 at 26,250, the IQR is about $6,840.
What percentile is one rep at? PERCENTRANK.INC
PERCENTRANK.INC answers the reverse question: given a value, where does it fall? =PERCENTRANK.INC(B2:B13,B10) for Ivan counts how many values are below his and divides by n - 1. The COUNTIF formula below does the same arithmetic.
Two details catch people out. First, PERCENTRANK.INC shows 3 significant digits by default and cuts off the rest rather than rounding, so 4/11 shows as 0.363, not 0.364. Add a third argument for more digits, such as =PERCENTRANK.INC(B2:B13,B10,4). Second, tied values get the same, lower rank: Ivan and Kofi both sold 21,400, so both get the rank of the first of the pair. PERCENTRANK.EXC divides by n + 1 instead, so it never returns exactly 0 or 1. If the value is below the smallest or above the largest number in the range, both return #N/A.
Result: 0.36363636364 shows as 36.4% with Percent format
About 0.364: 4 of the other 11 reps sold less than Ivan, so he is at roughly the 36th percentile. PERCENTRANK.INC shows this as 0.363. Kofi gets the same rank.
Percentile for one group only
There is no PERCENTILEIF. In Excel 365 or 2021, filter first: =PERCENTILE.INC(FILTER(C2:C50,B2:B50="West"),0.9) gives the 90th percentile for West reps only. In older versions, =PERCENTILE.INC(IF(B2:B50="West",C2:C50),0.9) does the same but must be confirmed with Ctrl+Shift+Enter. Blank cells and text in the range are ignored, but zeros count, so a rep with no sales entered as 0 drags every percentile down. Leave it empty if the rep was not active.
Common mistakes
Typing 90 instead of 0.9
k is a fraction. =PERCENTILE.INC(B2:B13,90) returns #NUM!. Use 0.9 or 90%.
Mixing INC and EXC in one report
The two methods give different answers on small data. Pick one, usually INC, and use it for every percentile, quartile and chart setting.
Expecting the top 10% to be exactly 10% of rows
On small lists it rarely is. If you need a fixed number of people, use LARGE with that count as the cutoff.
Reading PERCENTRANK as rounded
It truncates to 3 digits by default. Pass a larger significance, or use the COUNTIF version above if you need full precision.
FAQ
What is the difference between PERCENTILE.INC and PERCENTILE.EXC?
INC accepts any k from 0 to 1 and treats the smallest and largest values as the 0th and 100th percentile. EXC uses a slightly wider scale and returns #NUM! for k values too close to 0 or 1 for the size of the data. On large data sets they are nearly the same.
Is PERCENTILE the same as PERCENTILE.INC?
Yes. PERCENTILE and QUARTILE are the older names and calculate the same way as PERCENTILE.INC and QUARTILE.INC. They still work in current Excel, but the .INC names make your choice of method obvious to the next reader.
How do I find the top 10 percent in Excel?
Get the cutoff with =PERCENTILE.INC(range,0.9), then flag or count values at or above it with =B2>=cutoff or COUNTIF. Conditional formatting also has a built-in Top 10% rule under Home > Conditional Formatting > Top/Bottom Rules.
How do I calculate the interquartile range in Excel?
There is no IQR function. Subtract the first quartile from the third: =QUARTILE.INC(B2:B13,3)-QUARTILE.INC(B2:B13,1).
Is the 50th percentile the median?
Yes. PERCENTILE.INC(range,0.5), QUARTILE.INC(range,2) and MEDIAN(range) all return the same value.
Functions used
SMALLk-th smallestLARGEk-th largestCOUNTIFCounts cells that matchCOUNTCounts numbersMEDIANMiddle value
Related guides
- How to find the median in Excel
- How to find the top 5 values in Excel
- How to rank numbers in Excel
- How to calculate standard deviation in Excel
- How to calculate a z-score in Excel
- How to find the highest and lowest value in Excel
Updated