calc-hub logocalc-hub.net

Statistics Calculator

Paste a list of numbers to get the count, sum, mean, median and mode, the minimum, maximum and range, the quartiles and IQR, and the population variance and standard deviation. Type a percentile from 0 to 100 to get its value along with the five-number summary, worked by the inclusive method (Excel PERCENTILE.INC) or the exclusive one (PERCENTILE.EXC).

Percentile method

How to use the Statistics Calculator

  1. Type or paste your numbers in the Data Set box, separated by commas or spaces.
  2. Enter the percentile you want in the Percentile p box, from 0 to 100. Type 90 for the 90th percentile.
  3. Pick the inclusive method (Excel PERCENTILE.INC) or the exclusive method (Excel PERCENTILE.EXC).
  4. Press Calculate. After changing any entry, press it again to update the results.

Common descriptive statistics

Mean: μ = Σx/n · · · Median: middle value (or avg of two middle) · · · Variance: σ² = Σ(x − μ)²/n · · · SD: σ = √variance

Each statistic answers a different question. The mean, median and mode locate the center of the data. The mode is the value that appears most often. If no value repeats, there is no mode, and if several values tie for the most repeats, the calculator lists each of them. The range, IQR, variance and standard deviation measure how far it spreads. The variance and standard deviation here are the population versions, which divide by n. A sample calculation divides by n − 1 and comes out slightly larger.

Worked example

Dataset: 2, 4, 4, 7, 9, 13, 15. Count = 7, sum = 54, mean = 7.7143, median = 7, mode = 4. Min = 2, max = 15, range = 13. Population variance = 20.4898 and standard deviation = 4.5266. Q1 = 4, Q3 = 13, IQR = 9.

How the calculator finds percentiles and quartiles

Sort the data from smallest to largest and number the values x1 to xn. A percentile sits at a position h in that list. When h is a whole number, the percentile is the value at that position. When h falls between two positions, the calculator takes the lower value and adds the fractional part of h times the gap to the next value. This is linear interpolation between the closest ranks.

The inclusive method puts the pth percentile at h = (n − 1) × p / 100 + 1. The 0th percentile is the minimum, the 100th is the maximum, and every p in between has an answer. Excel's PERCENTILE.INC and NumPy's default method, "linear", give the same results. Hyndman and Fan (1996) list it as definition 7 of sample quantiles.

The exclusive method uses h = (n + 1) × p / 100, as in Excel's PERCENTILE.EXC. It needs h between 1 and n, so p has to lie between 100/(n + 1) and 100n/(n + 1). Outside that range Excel returns #NUM! and this calculator reports the percentile as undefined. Inside it, the results match NumPy's method="weibull", definition 6 in Hyndman and Fan.

The five-number summary is the minimum, Q1, median, Q3 and maximum, the five values a box plot draws. In the percentile results Q1 is the 25th percentile and Q3 the 75th, so they follow the method you pick, and the IQR is Q3 − Q1. The first block of results gives Q1 and Q3 by a third rule. Q1 is the median of the lower half of the sorted data and Q3 the median of the upper half, leaving out the middle value when n is odd.

Data 12, 15, 18, 20, 22, 25, 28, 30, 35, 41 (n = 10) by each method
StatisticInclusiveExclusiveHalves
Q118.517.2518
Median23.523.523.5
Q329.531.2530
IQR111412
90th percentile35.640.4Not offered
95th percentile38.3UndefinedNot offered

Inclusive method, step by step

For Q1, h = 9 × 25 / 100 + 1 = 3.25. The 3rd value is 18 and the 4th is 20, so Q1 = 18 + 0.25 × (20 − 18) = 18.5. The same steps give a median of 23.5 and Q3 = 29.5, so the IQR is 11. For p = 90, h = 9.1 and the 90th percentile is 35 + 0.1 × (41 − 35) = 35.6. The five-number summary is 12, 18.5, 23.5, 29.5, 41.

Exclusive method

Q1 sits at h = 11 × 25 / 100 = 2.75, between 15 and 18, so Q1 = 17.25. Q3 sits at h = 8.25, so Q3 = 31.25, and the 90th percentile is 40.4. With n = 10 the calculator accepts p from 9.091 to 90.909 for this method, so the 95th percentile comes back undefined.

Halves method

The lower half is 12, 15, 18, 20, 22 and the upper half is 25, 28, 30, 35, 41. Their medians give Q1 = 18 and Q3 = 30, an IQR of 12. Three rules, three different pairs of quartiles from the same ten numbers, which is why it pays to know which one your teacher or spreadsheet uses.

Frequently asked questions

How do you calculate a percentile?

Sort the data and find the position h = (n − 1) × p / 100 + 1. If h is a whole number, the percentile is the value at that position. If not, take the value just below h and add the fractional part of h times the gap to the next value. For 12, 15, 18, 20, 22, 25, 28, 30, 35, 41 and p = 90, h = 9.1, so the 90th percentile is 35 + 0.1 × 6 = 35.6. This is the inclusive method, the one Excel's PERCENTILE.INC uses.

What is the interquartile range (IQR)?

IQR = Q3 − Q1, the spread of the middle 50% of the data. Pushing the largest or smallest value further out leaves it unchanged unless the data set is tiny, while the range and the standard deviation grow with it. The calculator shows two IQRs, one from the halves quartiles and one from the percentile method you pick.

How does the calculator find Q1 and Q3?

Two ways. The first block of results sorts the data and splits it into a lower and an upper half. Q1 is the median of the lower half and Q3 is the median of the upper half, and with an odd count the middle value belongs to neither half. The percentile block takes Q1 as the 25th percentile and Q3 as the 75th by the method you pick, which matches Excel's QUARTILE.INC or QUARTILE.EXC. On the same data the two can differ.

What is the five-number summary?

The minimum, Q1, median, Q3 and maximum. A box plot draws exactly these five values. The calculator lists them in the percentile results, with Q1 and Q3 by the method you pick.

When should I use median instead of mean?

When data is skewed or has outliers (income, home prices). Mean is pulled by extreme values; median sits at the middle of the order. Both are reported in real-world data analysis.

How is variance different from standard deviation?

Variance is the average squared deviation from the mean; SD is the square root of variance. SD is in the same units as the original data, so it's more interpretable.

We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.