Percentile and Quartile Calculator
Enter a list of numbers to get the quartiles, the interquartile range and any percentile, using the inclusive (INC) or exclusive (EXC) method.
How the two methods work (INC and EXC)
Sort the data from smallest to largest. For a percentile p (from 0 to 1; 25% is 0.25), find its rank, meaning its position counted from the smallest. If the rank is not a whole number, the value is found by drawing a straight line between the two neighboring values (linear interpolation).
- INC: rank = (n − 1) × p + 1, where n is the count. Excel's PERCENTILE.INC and QUARTILE.INC use the same name and accept 0 to 1 inclusive, but this page has not compared its results with Excel itself. A p of 0 gives the minimum and 1 gives the maximum (0% and 100% are included). This is the default.
- EXC: rank = (n + 1) × p. Excel's PERCENTILE.EXC and QUARTILE.EXC use the same name and exclude 0 and 1, but this page has not compared its results with Excel itself. A value can be found only when the rank is from 1 to n (0% and 100% are not included).
Quartiles are the 25th, 50th and 75th percentiles (Q1, Q2 and Q3). The interquartile range is Q3 − Q1. Q2 is the median, and it matches the median from the Mean and Median Calculator with both INC and EXC.
The rank formulas above are the ones this calculator uses. Microsoft's documentation, which was checked for this page, states when each function returns an error and that these functions interpolate; it does not print a rank formula, so the formulas here are not quoted from it.
When EXC cannot give a result
EXC works only when p is from 1/(n+1) to n/(n+1) (both ends included). Outside that range the result is "Not available". Microsoft's documentation says PERCENTILE.EXC and QUARTILE.EXC return #NUM! for a k at or below 0 or at or above 1, and when the percentile cannot be interpolated; this calculator does not claim that its range is identical in every case.
- With 2 values or fewer, Q1 (25%) and Q3 (75%) are not available (25% is below 1/(n+1), and 75% is above n/(n+1)). Q2 (50%) is available with 1 or more values (with one value, it is that value). If Q1 or Q3 is not available, the interquartile range is not available either. Items that can be calculated are still shown.
- With 3 values, Q1 is the 1st value and Q3 is the 3rd (both are at the ends of the range, so they can be calculated).
- 0% and 100% are never available with EXC (with INC they are the minimum and the maximum).
- When a result is not available, the range of percentiles you can use for that count is shown.
Examples
- The 30th percentile of 1, 3, 2, 4 (INC) → rank = 3 × 0.3 + 1 = 1.9. Sorted, the data is 1, 2, 3, 4, so the value is between 1 and 2: 1.9.
- Q1 and Q3 (EXC) of 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49 (11 values) → ranks = 12 × 0.25 = 3 and 12 × 0.75 = 9. Q1 = 15, Q3 = 43.
- Q1 and Q3 (INC) of 1, 2, 3, 4, 5 → ranks = 4 × 0.25 + 1 = 2 and 4 × 0.75 + 1 = 4. Q1 = 2, Q3 = 4 (with EXC: Q1 = 1.5, Q3 = 4.5).
Notes
- Percentiles and quartiles have other definitions too (such as the nearest-rank method), and different software gives different results. This calculator handles only INC and EXC. Other software, such as R, NumPy or Google Sheets, may use other methods, and this page does not say which of them match INC or EXC. Check the method of the software you are comparing with.
- Values are calculated exactly to 6 decimal places. You can enter 1 to 1,000 values. Outlier detection and box plots are not included.
- For the mean and median, use the Mean and Median Calculator. For spread, use the Standard Deviation Calculator.
Sources and date checked
The behavior of INC and EXC was checked against Microsoft's support pages for PERCENTILE.INC, PERCENTILE.EXC and QUARTILE.EXC (checked October 31, 2026).
Frequently asked questions
Should I use INC or EXC?
Use the one that matches your software. If an Excel function name ends in INC or EXC, choose the same one, but check a result against Excel yourself, because this page has not done so. EXC leaves out 0% and 100%, so it may give no result when there are few values.
Why do different programs give different quartiles?
There is more than one definition for finding the rank. This calculator lets you choose INC or EXC and shows the formula for each.
When does EXC say "Not available"?
When p is below 1/(n+1) or above n/(n+1). With 2 values or fewer, Q1 and Q3 are not available.
Is the median the same as in the Mean and Median Calculator?
Yes. The 50th percentile equals the median with both INC and EXC.