HomeDescriptive StatisticsDescriptive Statistics Range Calculator - IQR & Midrange

Descriptive Statistics Range Calculator – IQR & Midrange

Descriptive Statistics Range Calculator - IQR & Midrange

Descriptive Statistics Range Calculator

This descriptive statistics range calculator gives you every measure of spread built on the smallest and largest value. The range itself is the largest value minus the smallest. This tool gives you that plus every variant that matters: the inclusive range for whole numbers, the midrange, the interquartile range, percentile ranges, and an estimate of the standard deviation from the range using the quality-control d₂ constants.

0. Quick Answer

range = maximum − minimum

For the values 45, 47, 48, 49, 50, 52, 54, 55, 56, 58, 61, 63 the range is 63 − 45 = 18. That is the entire calculation, and it is why the range is the first measure of spread anyone learns. Everything else on this page is a descriptive statistics range calculator built around that one subtraction: the variants, the quartile-based ranges, and the traps.

Range
18
max − min
Inclusive range
19
max − min + 1
Midrange
54
(max + min) ÷ 2
Interquartile range
7.75
Q3 − Q1

⚠ The one thing every other range calculator leaves out

The range grows as you collect more data. It is the only common measure of spread that does this. A standard deviation from 10 observations and from 1,000 observations estimate the same thing, but the range does not: with more observations you get more chances to catch an extreme value, so the range keeps climbing.

For normally distributed data the expected range is 1.13 standard deviations at n = 2, 3.08 at n = 10, 5.02 at n = 100 and 6.48 at n = 1,000. Nothing about the underlying spread changed. Only the sample size did.

The consequence: you cannot compare the range of one group against the range of another unless the two samples are the same size. Doing so is one of the most common errors in reporting, and it always makes the larger sample look more variable.

Key takeaways

  • The range uses exactly two numbers and throws the rest away. With 1,000 observations, 998 of them have no influence on it whatsoever.
  • It is maximally sensitive to outliers. A single mistyped value changes it completely, and the range gives you no signal that this happened.
  • Use the inclusive range for counted whole numbers. Test scores from 45 to 63 span 19 possible marks, not 18. Which one you want depends on whether you are measuring a distance or counting possibilities.
  • The interquartile range is the robust alternative. It describes the middle half and ignores both tails, so it is stable where the range is not.
  • You can estimate a standard deviation from the range. Divide by d₂, a constant that depends on n: 2.326 at n = 5, 3.078 at n = 10. This is the basis of every X-bar and R control chart in manufacturing.
  • The range rule of thumb, SD ≈ range / 4, works only around n = 15 to 30. It is badly wrong at both very small and very large sample sizes, for the same reason the range grows with n.

📚 1. What Is the Range?

1.1 The definition, and why it is the first thing anyone learns

The range is the distance from the smallest value in your data to the largest. Subtract the minimum from the maximum and you are done. No squaring, no averaging, no division, no choice of divisor.

That simplicity is its entire appeal. Anyone can compute it, anyone can check it, and it is expressed in the same units as the data. If daily temperatures ran from 4°C to 19°C, the range is 15°C, and everyone understands immediately what that means.

1.2 The five ranges people actually mean

"Range" is used loosely for several different quantities. This tool computes all of them, because which one you want depends on the question.

NameFormulaOn the exampleUse it when
Rangemax − min63 − 45 = 18Measuring a distance or span on a continuous scale
Inclusive rangemax − min + 163 − 45 + 1 = 19Counting how many whole values are possible
Midrange(max + min) ÷ 2(63 + 45) ÷ 2 = 54A very quick centre estimate, though a fragile one
Interquartile rangeQ3 − Q156.5 − 48.75 = 7.75You want a spread that outliers cannot distort
Semi-interquartile range(Q3 − Q1) ÷ 27.75 ÷ 2 = 3.875Older texts, sometimes called the quartile deviation
Percentile rangeP90 − P1060.7 − 47.1 = 13.6You want to trim the extremes without going all the way to quartiles
The range and the inclusive range are both correct. They answer different questions. Marks from 45 to 63 span a distance of 18 points, and there are 19 possible marks in that span. Confusion arises when someone counts possibilities and calls it a distance, which is the classic fencepost error: a fence 10 metres long with posts every metre needs 11 posts, not 10.

1.3 Why the range grows with sample size

This is the property that makes the range unlike every other measure of spread, and it is worth understanding properly.

The standard deviation estimates a fixed population quantity. Collect more data and your estimate gets more precise, but it does not systematically get bigger or smaller. The range has no such fixed target. Every new observation is another opportunity to beat the current maximum or fall below the current minimum, so the range can only ever stay the same or increase as n grows. It never decreases.

For normally distributed data the relationship is known exactly. The expected range is d₂ multiplied by the population standard deviation, where d₂ depends only on the sample size:

Sample sizeExpected rangeSample sizeExpected range
n = 21.13 σn = 504.50 σ
n = 52.33 σn = 1005.02 σ
n = 103.08 σn = 5006.07 σ
n = 304.09 σn = 1,0006.48 σ

Two samples drawn from the identical population, one of 10 values and one of 1,000, will have ranges differing by more than a factor of two. Neither population is more variable than the other. This is why comparing ranges across samples of different sizes is meaningless, and why the range is unsuitable as a summary statistic in any context where sample sizes vary.

1.4 What the range does not tell you

It uses two numbers and discards everything in between. Consider two datasets that both run from 0 to 100. In the first, values are spread evenly across the whole interval. In the second, 998 values sit at 50 and one each at 0 and 100. Identical ranges, utterly different data.

The range also carries no information about the centre, the shape, or where the bulk of the data sits. It is a statement about the two most extreme observations, and extreme observations are precisely the ones most likely to be errors.

1.5 Where the range genuinely is the right choice

Despite all of that, there are situations where the range is not merely acceptable but preferred:

  • Quality control with small subgroups. Taking five parts an hour and plotting the range is fast, requires no calculator, and at n = 5 the range is nearly as efficient as the standard deviation. This is why X-bar and R charts have dominated factory floors for a century.
  • Specification and tolerance limits. When you need to know the worst case rather than the typical case, the extremes are the quantity of interest.
  • Reporting to a non-technical audience. "Between 4 and 19 degrees" is understood instantly by everyone.
  • A first sanity check. An impossible minimum or maximum reveals a data-entry error faster than any other statistic.
  • Genuinely tiny samples. Below about n = 6 the range loses very little information compared with the standard deviation.
The efficiency crossover. At n = 2 the range is 100% as efficient as the standard deviation for estimating spread. At n = 5 it is about 96%, at n = 10 about 85%, and by n = 20 it has fallen to roughly 70%. Below about n = 8 you lose almost nothing by using the range. Above about n = 12 you are discarding real information, which is exactly why control charts use small subgroups.

🧮 2. Set Up Your Calculation

Paste your numbers and the calculator returns every kind of range, the values that produced them, and a warning if a single extreme observation is driving the result.

One column is loaded by default. Press Add cluster to compare groups.
A trimmed range that ignores the most extreme values.
📁 Or upload a CSV / Excel file
Supports .csv, .txt, .xlsx and .xls. Every column you click becomes its own cluster.

If you already know the smallest and largest values, that is all the range needs. Add the sample size and the calculator can also estimate the standard deviation.

Lets the tool estimate the SD and flag whether the range is comparable to another group's.
Whole numbers get the inclusive range highlighted instead.

For data already summarised into classes. The range of grouped data is an approximation, because you only know the class an observation fell into, not its actual value.

The range can estimate a standard deviation by dividing by d₂, a constant that depends on the sample size. This is how X-bar and R control charts have worked since the 1920s.

The d₂ constant depends entirely on this. Published tables usually stop at 25.
If your range is an average of several subgroup ranges, enter how many.

Enter several groups to compare. The calculator will warn you if the sample sizes differ, because the range cannot be compared fairly across different n.

Paste each group's values. The comparison table will show the range, the IQR and a size-adjusted range for each.

All are always calculated. This only decides which one headlines.
Different conventions give slightly different IQRs on the same data.

📊 3. Results

Enter your numbers above and press Calculate Range. Every kind of range, the ruler diagram, charts and reporting sentences will appear here.

🧠 4. Interpretation of Results, In Detail

Run the calculator to fill this section with your own numbers. The ten sub-sections below explain every part of the output.

4.1 Reading the number

The range is a distance, expressed in the same units as your data. A range of 18 marks means the best and worst results were 18 points apart. A range of 15°C means the hottest and coldest days differed by 15 degrees.

What it does not tell you is where anything sits between those two points. The range is identical whether the data cluster tightly near the middle with two stragglers at the edges, or spread evenly across the whole interval. It is a statement about two observations and nothing else.

4.2 Range or inclusive range?

Both are correct and they answer different questions. Ask yourself whether you are measuring a distance or counting possibilities.

Marks running from 45 to 63 span a distance of 18 points. But there are 19 possible whole marks in that span, because both endpoints count. This is the fencepost problem: a 10-metre fence with a post every metre needs 11 posts.

Use the plain range whenUse the inclusive range when
Measuring a continuous quantity such as temperature, weight or timeCounting whole units such as marks, days, dice faces or people
Reporting how far apart the extremes areReporting how many distinct values are covered
Feeding into any statistical formula, including d₂Describing a span in everyday language
"The temperature varied by 15 degrees""The survey ran for 19 days"

Statistical formulas always want the plain range. If you feed an inclusive range into a d₂ calculation you will overestimate the standard deviation, and the error is largest on small numbers.

4.3 Why the range grows with sample size, and why it matters so much

This is the most important idea on the page and it is what separates the range from every other measure of spread.

The standard deviation, the variance and the interquartile range all estimate fixed properties of the population. Collect more data and your estimates get more precise, but they do not systematically drift in one direction. The range has no fixed target to estimate. Each new observation is another chance to exceed the current maximum or fall below the current minimum, so the range can only stay the same or increase. It literally cannot decrease.

For normal data the expected range is exactly d₂ standard deviations, where d₂ depends only on n. That produces this progression:

nExpected rangeRelative to n = 10
21.13 σ37%
52.33 σ76%
103.08 σ100%
304.09 σ133%
1005.02 σ163%
1,0006.48 σ211%
The practical consequence. If you compare the range of a 50-person group against the range of a 10-person group, you will conclude the larger group is more variable even when the two populations are identical. The effect is roughly a 46% inflation, purely from sample size. This error appears constantly in reports comparing departments, regions or time periods of different sizes, and it always favours the same conclusion: bigger samples look more spread out.

The fix is straightforward. Either compare groups of equal size, or compare interquartile ranges instead, or divide each range by its own d₂ constant, which is what the comparison tab does automatically.

4.4 How fragile is your range?

Because the range is built from the two most extreme observations, it is maximally exposed to exactly the values most likely to be wrong. A misplaced decimal point, a transcription slip, an instrument glitch: any of these lands at one end of the sorted data and controls the entire result.

The calculator reports what happens when you remove just one value from each end. On well-behaved data the range falls modestly. When it collapses by more than half, two observations were carrying the whole result, and you should look at them individually before reporting anything.

The ratio of the range to the interquartile range is a second useful signal. On roughly normal data it usually sits between 2 and 4, rising slowly with sample size. A ratio above about 6 means the tails are much longer than the middle, which is either genuine skew or a stray value.

4.5 The interquartile range, and when to prefer it

The interquartile range is the distance from the 25th to the 75th percentile: the span of the middle half. Because it ignores the top and bottom quarters entirely, no single extreme value can move it, and it is far more stable across different sample sizes.

Prefer the IQR whenever your data are skewed, whenever outliers are plausible, and whenever you need to compare groups. Prefer the plain range when the extremes themselves are the point, as in tolerance specifications or worst-case planning, or when your audience needs the simplest possible summary.

Three quartile conventions, three slightly different answers. Linear interpolation (Excel's QUARTILE.INC, R's default type 7), Tukey's hinges, and the exclusive method (QUARTILE.EXC, R type 6) can each give a different IQR on the same data. On the twelve exam marks they give 7.75, 8.50 and 9.25 respectively. None is wrong; they answer the same question with different interpolation rules. Say which you used, and this calculator lets you switch between them.

4.6 Estimating a standard deviation from the range

Divide the range by d₂ and you have an estimate of the standard deviation. This is not a rough approximation invented for convenience: d₂ is the exact expected range for a normal sample of that size, so the estimator is unbiased.

Its appeal is speed. An operator can measure five parts, subtract the smallest from the largest, and divide by 2.326 in their head. At n = 5 that estimate retains about 96% of the efficiency of a properly computed standard deviation. Walter Shewhart built control charts on exactly this trade in the 1920s, and the method survives because the efficiency loss is small where it matters and the practical gain is enormous.

Efficiency falls as subgroups grow: roughly 85% at n = 10 and below 70% by n = 20. That is precisely why control charts use small subgroups and why d₂ tables usually stop at 25. Beyond that, compute the standard deviation properly.

4.7 The range rule of thumb, and where it goes wrong

The familiar shortcut says SD ≈ range / 4. It works because d₂ happens to pass through 4 somewhere around n = 25, so for middling sample sizes the rule is close.

Outside that window it drifts badly. At n = 5, d₂ is 2.33, so dividing by 4 underestimates the standard deviation by 42%. At n = 1,000, d₂ is 6.48, so dividing by 4 overestimates it by 62%. The rule is not wrong so much as tied to a sample size nobody states when quoting it.

Use it for a quick sanity check on a moderate sample. If your computed standard deviation differs from range/4 by a factor of five, you have made an arithmetic error. For anything you intend to report, use the proper d₂ value.

4.8 Grouped data gives you a range you cannot pin down

When data arrive as a frequency table you know which class each observation fell into but not its value. That leaves two defensible answers: the distance between the outer class boundaries, which is the widest the range could possibly be, and the distance between the outer class midpoints, which is the average case.

The true range lies between them, and grouped data cannot narrow it further. The midpoint estimate is usually the more honest choice, because assuming both extreme observations sat exactly on class boundaries is an unlikely coincidence. Whichever you use, say so.

Open-ended classes make the range impossible. A top class of "60 and over" has no upper boundary, so there is no maximum and no range. Inventing a closing value is sometimes done, but that guess goes straight into the answer.

4.9 Reading the four charts

Chart 1 plots your sorted values with the minimum and maximum marked, so you can see immediately whether the extremes sit close to the rest or far out on their own. Chart 2 is the important one: it shows the expected range climbing with sample size and marks your own n on the curve. Chart 3 puts the range beside the interquartile range, the percentile range and the standard deviation, all in your original units. Chart 4 shows how fast the range shrinks as you trim values from each end, with the interquartile range drawn across for reference.

Chart 4 is the diagnostic. A steep initial drop followed by a flat stretch means one or two extreme values were doing all the work.

4.10 What to report alongside the range

Never report a range alone. At minimum give the sample size, because a range without n cannot be judged and cannot be compared with anything. Give the minimum and maximum themselves, since readers usually want to know where the span sits, not just how wide it is.

Add the interquartile range whenever there is any chance of skew or outliers. If you are comparing groups, either match the sample sizes or report the adjusted ranges, and say which you did. And if the range is the headline figure in a report, state explicitly that it is determined by two observations, so a reader knows how much weight it can bear.

5. How to Write Your Results in Research

▶ Run the analysis above to auto-fill all five examples with your results.

Example 1, Full Sentence for a Paper
Run the calculator to generate this sentence from your data.
📌 Key conventions for this style
  • Give the minimum and maximum, not just the difference. Readers want to know where the span sits.
  • Always include the sample size. A range without n is uninterpretable.
  • Report the interquartile range alongside whenever skew or outliers are plausible.
  • Write "ranged from X to Y" rather than "the range was Z" where space allows.
Example 2, Compact Inline Format
Run the calculator to generate this snippet.
📌 Key conventions for this style
  • For tables, figure captions and parenthetical use.
  • The convention "range 45 to 63" is clearer than "range 18" on its own.
  • Keep n even when compressing.
Example 3, Plain-Language Summary
Run the calculator to generate this summary.
📌 Key conventions for this style
  • "From X to Y" is understood by everyone and needs no explanation.
  • Avoid the word "range" as a technical term with a general audience.
  • Mention the typical case as well as the extremes, or readers will assume the extremes are typical.
Example 4, Methods Note
Run the calculator to generate this methods note.
📌 Key conventions for this style
  • State whether you used the plain or inclusive range if there is any ambiguity.
  • If comparing groups, say how you handled unequal sample sizes.
  • If the data were grouped, say which convention you used for the outer classes.
  • Name the quartile method if you report an interquartile range.
Example 5, Robustness Note
Run the calculator to generate this statement.
📌 Key conventions for this style
  • Reviewers increasingly ask what a dispersion figure is sensitive to.
  • Say that both extremes were checked against the original records.
  • Report the trimmed range or the IQR when the extremes dominate.
  • Never claim one group is "more variable" from ranges alone if sample sizes differ.

6. Formulas Used

The Range
R = xmax − xmin
xmaxThe largest value in the dataset
xminThe smallest value
UnitsThe same as your data
Never negativeThe maximum is by definition at least the minimum
UsesExactly two observations, regardless of how many you collected
Inclusive Range, for Counted Whole Numbers
Rinc = xmax − xmin + 1
Why the +1Both endpoints are counted. The fencepost problem
45 to 63A distance of 18, but 19 possible whole marks
Use forMarks, days, counts, dice faces, discrete categories
Never use forContinuous measurements, or as input to any statistical formula
Midrange
M = (xmax + xmin) ÷ 2
What it isA measure of centre, not of spread
Breakdown pointZero. A single outlier moves it without limit
Compare withThe mean and median, which are far more stable
Genuinely useful forSymmetric bounded data, and quick mental estimates
Interquartile Range and Semi-Interquartile Range
IQR = Q3 − Q1  ·  SIQR = (Q3 − Q1) ÷ 2
Q₁, Q₃The 25th and 75th percentiles
CoversThe middle half of the data
Breakdown point25%. A quarter of the data can be arbitrary without moving it
Three conventionsLinear, Tukey hinges and exclusive give slightly different answers
Also calledThe quartile deviation, for the semi version
Percentile Range
Rp = P100−p − Pp
10 to 90Trims the most extreme 10% at each end
5 to 95A gentler trim, common in reference intervals
25 to 75Is exactly the interquartile range
Trade-offTrimming more gives stability but discards genuine information
Expected Range, and Why It Grows With n
E[R] = d₂(n) × σ
d₂(n)A constant depending only on the sample size, for normal data
n = 2d₂ = 1.128
n = 10d₂ = 3.078
n = 100d₂ = 5.015
ConsequenceRanges from different sample sizes are not comparable
Derivationd₂ = ∫ [1 − Φ(x)ⁿ − (1−Φ(x))ⁿ] dx
Estimating the Standard Deviation from the Range
σ̂ = R ÷ d₂(n)  ·  rough rule: σ̂ ≈ R ÷ 4
UnbiasedBecause d₂ is the exact expected range for normal data
n = 5Divide by 2.326, not 4. The rule of thumb underestimates by 42%
n = 25d₂ = 3.931, so range / 4 is nearly right here
n = 1000Divide by 6.483. The rule overestimates by 62%
EfficiencyAbout 96% at n = 5, 85% at n = 10, under 70% by n = 20
Control Chart Constants Built from the Range
D₃ = 1 − 3d₃/d₂  ·  D₄ = 1 + 3d₃/d₂  ·  A₂ = 3 ÷ (d₂√n)
d₃The standard deviation of the range itself
R chart limitsD₃ × R̄ and D₄ × R̄
X-bar limitsx̄̄ ± A₂ × R̄
D₃ = 0For n below 7, because the lower three-sigma bound falls below zero
n = 5D₄ = 2.114, A₂ = 0.577, the values on every SPC card
Grouped Data, Two Possible Answers
Rbound = Ulast − Lfirst  ·  Rmid = mlast − mfirst
U, LThe outer class boundaries
mThe outer class midpoints
Boundary versionThe widest the true range could be
Midpoint versionThe average case, usually the more honest estimate
Impossible whenAny class is open-ended, such as "60 and over"

📝 7. How to Use This Calculator

  1. Paste your numbers into the data column. From my data opens first with one column ready. Enter values comma-separated exactly as the placeholder shows, and the calculator returns the range, the inclusive range, the midrange, the interquartile range and a trimmed percentile range all at once.
  2. Read the ruler diagram first. It draws the full range as a pale band with the interquartile range as a darker inner bar and every observation plotted as a dot. If the dots bunch in the middle with one stray at an end, you will see it immediately.
  3. Check the extremes before you trust the number. The range is built from exactly two observations, and the calculator tells you how much it falls when you remove one from each end. A drop above 50% means two values are controlling everything.
  4. Pick the plain or inclusive range deliberately. Plain for distances and for any statistical formula, inclusive for counting whole values. The tool shows both so the choice is visible rather than accidental.
  5. Load a sample dataset to see the failure modes. Nine are built in, including one where a single typo inflates the range from 18 to 585, one where every value is identical, and one showing three sample sizes drawn from the same spread.
  6. To compare groups, use the compare tab rather than eyeballing two ranges. It warns you when the sample sizes differ and adds a size-adjusted column, because the range grows with n and raw comparisons are misleading.
  7. For a frequency table, use the grouped tab. It gives both the boundary range and the midpoint range, since grouped data cannot pin the true value down to one number.
  8. To estimate a standard deviation, use the SD tab. Enter the range and the subgroup size and it divides by the correct d₂ constant, and optionally gives you the D₃, D₄ and A₂ factors for a control chart.
  9. Choose your quartile method if you care about the IQR. Linear interpolation matches Excel and R's default; Tukey hinges and the exclusive method give slightly different answers on the same data. Say which you used.
  10. Press Calculate Range. Nothing is computed until you do, and changing any input clears the results so you never read stale numbers.

📊 8. How to Calculate the Range in Excel

Excel has no RANGE function, which catches almost everyone the first time. You subtract MIN from MAX yourself. Below is the complete workflow in ten steps, each with a picture of what your sheet should look like.

The functions you need. MIN and MAX for the range itself, QUARTILE.INC for the interquartile range, PERCENTILE.INC for trimmed ranges, and LARGE and SMALL when you want the second or third most extreme value.
Xrange.xlsx - ExcelA1fxValueABCD1ValueStatisticResult252Minimum348Maximum455Range561Inclusive range647Midrange758Q1850Q3963IQR10

Step 1. Put your data in one column with a header and reserve a block for the results. Twelve values sit in A2:A13; only the first eight are visible.

Xrange.xlsx - ExcelD2fx=MIN(A2:A13)ABCD1ValueStatisticResult252Minimum45348Maximum455Range561Inclusive range647Midrange758Q1850Q3963IQR10

Step 2. MIN finds the smallest value, 45. It ignores text and blank cells.

Xrange.xlsx - ExcelD3fx=MAX(A2:A13)ABCD1ValueStatisticResult252Minimum45348Maximum63455Range561Inclusive range647Midrange758Q1850Q3963IQR10

Step 3. MAX finds the largest, 63.

Xrange.xlsx - ExcelD4fx=MAX(A2:A13)-MIN(A2:A13)ABCD1ValueStatisticResult252Minimum45348Maximum63455Range18561Inclusive range647Midrange758Q1850Q3963IQR10

Step 4. The range in a single formula. Excel has no RANGE function, which surprises people, so you subtract MIN from MAX yourself.

Xrange.xlsx - ExcelD5fx=D4+1ABCD1ValueStatisticResult252Minimum45348Maximum63455Range18561Inclusive range19647Midrange758Q1850Q3963IQR10

Step 5. The inclusive range adds 1, giving 19. Use this only when the values are whole numbers being counted, never as input to a statistical formula.

Xrange.xlsx - ExcelD6fx=(MAX(A2:A13)+MIN(A2:A13))/2ABCD1ValueStatisticResult252Minimum45348Maximum63455Range18561Inclusive range19647Midrange54758Q1850Q3963IQR10

Step 6. The midrange, halfway between the two extremes. Note this is a measure of centre, not of spread, and one outlier moves it without limit.

Xrange.xlsx - ExcelD7fx=QUARTILE.INC(A2:A13,1)ABCD1ValueStatisticResult252Minimum45348Maximum63455Range18561Inclusive range19647Midrange54758Q148.75850Q356.50963IQR10

Step 7. QUARTILE.INC uses linear interpolation and matches R's default. QUARTILE.EXC would give 48.25 instead, which is a different convention rather than an error.

Xrange.xlsx - ExcelD9fx=QUARTILE.INC(A2:A13,3)-QUARTILE.INC(A2:A13,1)ABCD1ValueStatisticResult252Minimum45348Maximum63455Range18561Inclusive range19647Midrange54758Q148.75850Q356.50963IQR7.7510

Step 8. The interquartile range, 7.75. This is the robust alternative: no single extreme value can change it.

Xrange.xlsx - ExcelB5fx=B2/B4AB1QuantityValue2Range183Subgroup size n124d2 constant3.25855Estimated SD5.52416Range / 4 rule

Step 9. Estimating the standard deviation. Excel has no built-in d2, so type the constant from the table in section 11 into its own cell and divide. At n = 12, d2 is 3.2585.

Xrange.xlsx - ExcelB6fx=B2/4AB1QuantityValue2Range183Subgroup size n124d2 constant3.25855Estimated SD5.52416Range / 4 rule4.5000

Step 10. The range-over-four rule gives 4.50 against the correct 5.52, an underestimate of 19%. The rule is only close for n somewhere between 15 and 30.

The complete function reference

What you wantExcel formulaResult on the example
Minimum=MIN(A2:A13)45
Maximum=MAX(A2:A13)63
Range=MAX(A2:A13)-MIN(A2:A13)18
Inclusive range=MAX(A2:A13)-MIN(A2:A13)+119
Midrange=(MAX(A2:A13)+MIN(A2:A13))/254
First quartile=QUARTILE.INC(A2:A13,1)48.75
Third quartile=QUARTILE.INC(A2:A13,3)56.50
Interquartile range=QUARTILE.INC(A2:A13,3)-QUARTILE.INC(A2:A13,1)7.75
IQR, exclusive convention=QUARTILE.EXC(A2:A13,3)-QUARTILE.EXC(A2:A13,1)9.25
Semi-interquartile range=(QUARTILE.INC(r,3)-QUARTILE.INC(r,1))/23.875
5th to 95th percentile range=PERCENTILE.INC(r,0.95)-PERCENTILE.INC(r,0.05)15.80
Second largest value=LARGE(A2:A13,2)61
Second smallest value=SMALL(A2:A13,2)47
Range after trimming one each end=LARGE(r,2)-SMALL(r,2)14
Range with a condition=MAXIFS(A:A,B:B,"x")-MINIFS(A:A,B:B,"x")Excel 2019 and later
SD estimated from the range=range/d2 with d2 typed in a cell5.5241 at n = 12
Count of values at the maximum=COUNTIF(A2:A13,MAX(A2:A13))1

Six mistakes that catch people out

  • Looking for a RANGE function. There isn't one. In Excel, "range" means a block of cells, which is why the statistical function was never given that name.
  • Forgetting the +1 when counting. If you are counting how many whole marks a span covers, you need the inclusive range. Marks from 45 to 63 cover 19 values, not 18.
  • Adding the +1 to a continuous measurement. The opposite error. A temperature range of 15.3 degrees is not 16.3 degrees.
  • Using QUARTILE.EXC and QUARTILE.INC interchangeably. On this data they give 9.25 and 7.75. Neither is wrong, but mixing them within one report is.
  • Including the header row. Excel ignores text, so it will not error, but a numeric header becomes data and can silently become your minimum or maximum.
  • Comparing ranges from ranges of different length. A range computed from 50 rows and one from 10 rows are not comparable, and no Excel formula will warn you.
Google Sheets. Every formula above works unchanged. Sheets also has QUARTILE as a legacy alias for QUARTILE.INC. MAXIFS and MINIFS are available in Sheets and in Excel 2019 or later.
Watch the status bar. Selecting a block of cells shows the average, count and sum by default, but not the minimum or maximum. Right-click the status bar to add them, and you get the two numbers you need for the range without typing a formula at all.

📈 9. How to Calculate the Range in R

R does have a range() function, but it does not return what you probably expect. This trips up almost every beginner.

The trap in R. range(x) returns a vector of two numbers, the minimum and the maximum, not the difference between them. range(c(45,63)) gives 45 63. To get the range as a single number you need diff(range(x)). Assigning r <- range(x) and then using r as if it were a scalar is a very common and very silent error.
R, base packages only
# Range Calculator in R (base R, no packages)

x <- c(52, 48, 55, 61, 47, 58, 50, 63, 45, 56, 54, 49)
n <- length(x)

# ---- 1. Every kind of range -------------------------------------------
range(x)                      # CAREFUL: returns c(min, max), NOT the range
rng       <- diff(range(x))   # this is the actual range: 18
inclusive <- rng + 1          # for counted whole numbers: 19
midrange  <- sum(range(x))/2  # a centre, not a spread: 54

qs   <- quantile(x, c(.25, .75))          # type 7, the R default
iqr  <- IQR(x)                            # same thing, one function
siqr <- iqr / 2

p    <- quantile(x, c(.05, .95))
prng <- unname(diff(p))

# ---- 2. How much rests on two observations? ---------------------------
s        <- sort(x)
trimmed  <- s[n-1] - s[2]                 # drop one from each end
trim_pct <- (rng - trimmed) / rng * 100

# ---- 3. The d2 constant: expected range of n normals ------------------
d2 <- function(m) {
  integrate(function(t) 1 - pnorm(t)^m - (1 - pnorm(t))^m,
            -12, 12)$value
}
sd_actual <- sd(x)
sd_from_r <- rng / d2(n)      # unbiased estimator of sigma
sd_rule   <- rng / 4          # the crude rule of thumb

cat(sprintf("n = %d   min = %g   max = %g\n", n, min(x), max(x)))
cat(sprintf("RANGE           = %g\n", rng))
cat(sprintf("inclusive range = %g\n", inclusive))
cat(sprintf("midrange        = %g\n", midrange))
cat(sprintf("Q1, Q3          = %.4f, %.4f   IQR = %.4f\n", qs[1], qs[2], iqr))
cat(sprintf("5th to 95th     = %.4f   trim one each end: %g -> %g (%.1f%% gone)\n",
            prng, rng, trimmed, trim_pct))
cat(sprintf("d2(%d) = %.6f   SD from range = %.6f   actual SD = %.6f\n",
            n, d2(n), sd_from_r, sd_actual))
cat(sprintf("range / 4 rule  = %.6f\n", sd_rule))

cat("\nTHE RANGE GROWS WITH SAMPLE SIZE:\n")
for (m in c(2, 5, 10, 30, 100, 1000))
  cat(sprintf("  n = %-5d expected range = %.4f sigma\n", m, d2(m)))

# ---- 4. One figure ----------------------------------------------------
plot(s, rep(0, n), pch = 19, cex = 1.6, col = "#b45309", bty = "n",
     yaxt = "n", ylab = "", xlab = "value", ylim = c(-0.16, 0.16),
     main = sprintf("Range and IQR   n=%d, range=%g, IQR=%g", n, rng, iqr))
segments(min(x), 0, max(x), 0, lwd = 9, col = adjustcolor("#b45309", .30))
segments(qs[1], 0, qs[2], 0, lwd = 9, col = adjustcolor("#0f766e", .55))
points(s, rep(0, n), pch = 19, cex = 1.6, col = "#b45309")
segments(c(min(x), max(x)), -0.05, c(min(x), max(x)), 0.05,
         lwd = 3, col = "#b45309")
text(c(min(x), max(x)), 0.08,
     sprintf(c("min %g", "max %g"), c(min(x), max(x))), col = "#b45309", cex = 0.85)
segments(midrange, -0.035, midrange, 0.035, lwd = 2, col = "#0f172a")
text(midrange, -0.09, sprintf("midrange %g", midrange), cex = 0.85)
legend("topleft", bty = "n", cex = 0.85,
       legend = c(sprintf("range = %g", rng), sprintf("IQR = %g", iqr)),
       col = c(adjustcolor("#b45309", .5), adjustcolor("#0f766e", .7)), lwd = 9)

What the script prints

n = 12   min = 45   max = 63
RANGE           = 18
inclusive range = 19
midrange        = 54
Q1, Q3          = 48.7500, 56.5000   IQR = 7.7500
5th to 95th     = 15.8000   trim one each end: 18 -> 14 (22.2% gone)
d2(12) = 3.258455   SD from range = 5.524090   actual SD = 5.670231
range / 4 rule  = 4.500000

THE RANGE GROWS WITH SAMPLE SIZE:
  n = 2     expected range = 1.1284 sigma
  n = 5     expected range = 2.3259 sigma
  n = 10    expected range = 3.0775 sigma
  n = 30    expected range = 4.0855 sigma
  n = 100   expected range = 5.0152 sigma
  n = 1000  expected range = 6.4829 sigma

These are the same numbers the Python script produces and the same numbers the calculator at the top of this page produces.

Line-by-line explanation

  • Block 1 opens with the trap deliberately visible. range(x) on its own prints two numbers; only diff(range(x)) gives you the range as a scalar. Note also that IQR(x) exists as a one-word function while there is no equivalent for the plain range.
  • Block 2 quantifies how fragile the result is by dropping one value from each end. On clean data the fall is modest; on data with a stray value it collapses.
  • Block 3 computes d₂ by numerical integration rather than looking it up, which means it works for any n rather than only the values printed in textbook tables.
  • Block 4 draws the range as a wide pale bar with the interquartile range overlaid, which is the clearest way to show how much narrower the middle half is.

Useful one-liners

TaskRNote
Minimum and maximumrange(x)returns two numbers, not one
The rangediff(range(x))this is what you usually want
Also the rangemax(x) - min(x)clearer to read
Inclusive rangediff(range(x)) + 1whole numbers only
Midrangemean(range(x))neat, and it works
Interquartile rangeIQR(x)type 7 by default
IQR, other conventionsIQR(x, type = 6)types 1 to 9 available
Percentile rangediff(quantile(x, c(.05,.95)))unname() to drop the label
Ignore missing valuesrange(x, na.rm = TRUE)otherwise NA propagates
Range by grouptapply(x, g, function(v) diff(range(v)))no built-in shortcut
Range of every columnsapply(df, function(v) diff(range(v)))
Five number summaryfivenum(x)Tukey's version, includes both extremes
Everything at oncesummary(x)gives min, quartiles, median, mean, max
Rolling rangezoo::rollapply(x, 5, function(v) diff(range(v)))needs the zoo package

🐍 10. How to Calculate the Range in Python

NumPy has a dedicated function with an unhelpful name, and it is the one everybody misses. The script below was run before being published, so the output shown underneath is the real console output.

The function nobody finds. NumPy's range function is called np.ptp(), short for "peak to peak". Almost nobody guesses that name, so most people write x.max() - x.min() instead, which is fine and arguably clearer. Note that ptp on an integer array can silently overflow: np.ptp(np.array([-128, 127], dtype=np.int8)) returns −1 rather than 255, because 255 does not fit in an int8. Cast to float first if your data are near the limits of their type.
Python 3, NumPy + SciPy + Matplotlib
# Range Calculator in Python
# Range, inclusive range, midrange, IQR, percentile ranges, and the d2 estimator.
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from scipy import stats, integrate

# ---- 1. Your data -----------------------------------------------------
x = np.array([52, 48, 55, 61, 47, 58, 50, 63, 45, 56, 54, 49], dtype=float)
n = x.size

# ---- 2. Every kind of range -------------------------------------------
lo, hi    = x.min(), x.max()
rng       = hi - lo                 # THE range: max minus min
inclusive = rng + 1                 # for counted whole numbers
midrange  = (hi + lo) / 2           # a centre, not a spread

q1, q3 = np.percentile(x, [25, 75]) # linear interpolation, matches Excel and R
iqr    = q3 - q1
siqr   = iqr / 2

p5, p95 = np.percentile(x, [5, 95])
prange  = p95 - p5

# ---- 3. How much rests on two observations? ---------------------------
s = np.sort(x)
trimmed  = s[-2] - s[1]             # drop one from each end
trim_pct = (rng - trimmed) / rng * 100

# ---- 4. The d2 constant: expected range of n normals -------------------
def d2(m):
    f = lambda t: 1 - stats.norm.cdf(t)**m - (1 - stats.norm.cdf(t))**m
    return integrate.quad(f, -12, 12, limit=400)[0]

sd_actual = x.std(ddof=1)
sd_from_r = rng / d2(n)             # unbiased estimator of sigma
sd_rule   = rng / 4                 # the crude rule of thumb

# ---- 5. Control chart constants (SPC) ---------------------------------
def PWgt(w, m):
    g = lambda t: stats.norm.pdf(t)*(stats.norm.cdf(t+w) - stats.norm.cdf(t))**(m-1)
    return 1 - m*integrate.quad(g, -12, 12, limit=400)[0]
def d3(m):
    mu = d2(m)
    e2 = integrate.quad(lambda w: 2*w*PWgt(w, m), 0, 14, limit=400)[0]
    return np.sqrt(max(0.0, e2 - mu*mu))

sub = 5                             # typical control chart subgroup
D3  = max(0.0, 1 - 3*d3(sub)/d2(sub))
D4  = 1 + 3*d3(sub)/d2(sub)
A2  = 3 / (d2(sub) * np.sqrt(sub))

print(f"n = {n}   min = {lo:g}   max = {hi:g}")
print(f"RANGE           = {rng:g}")
print(f"inclusive range = {inclusive:g}   (max - min + 1, for whole numbers)")
print(f"midrange        = {midrange:g}")
print(f"Q1, Q3          = {q1:.4f}, {q3:.4f}   IQR = {iqr:.4f}   semi-IQR = {siqr:.4f}")
print(f"5th to 95th     = {p5:.4f} to {p95:.4f}   range = {prange:.4f}")
print(f"trim one each end: {rng:g} -> {trimmed:g}  ({trim_pct:.1f}% of the range gone)")
print(f"range / IQR     = {rng/iqr:.4f}   (2 to 4 is typical for normal data)")
print()
print(f"d2({n})          = {d2(n):.6f}")
print(f"SD from range   = {sd_from_r:.6f}   actual SD = {sd_actual:.6f}"
      f"   error {abs(sd_from_r-sd_actual)/sd_actual*100:.1f}%")
print(f"range / 4 rule  = {sd_rule:.6f}")
print()
print(f"SPC at n={sub}: d2={d2(sub):.4f}  d3={d3(sub):.4f}  "
      f"D3={D3:.4f}  D4={D4:.4f}  A2={A2:.4f}")
print()
print("THE RANGE GROWS WITH SAMPLE SIZE:")
for m in (2, 5, 10, 30, 100, 1000):
    print(f"  n = {m:<5d} expected range = {d2(m):.4f} sigma")

# ---- 6. One figure ----------------------------------------------------
fig, ax = plt.subplots(figsize=(9, 5))
ax.scatter(s, np.zeros(n), s=90, color="#b45309", zorder=4, label="observations")
ax.hlines(0, lo, hi, color="#b45309", lw=9, alpha=.30, zorder=2,
          label=f"range = {rng:g}")
ax.hlines(0, q1, q3, color="#0f766e", lw=9, alpha=.55, zorder=3,
          label=f"IQR = {iqr:g}")
for v, lab in [(lo, f"min {lo:g}"), (hi, f"max {hi:g}")]:
    ax.vlines(v, -0.05, 0.05, color="#b45309", lw=3, zorder=5)
    ax.annotate(lab, (v, 0.07), ha="center", fontsize=9, color="#b45309")
ax.vlines(midrange, -0.035, 0.035, color="#0f172a", lw=2, zorder=5)
ax.annotate(f"midrange {midrange:g}", (midrange, -0.09), ha="center",
            fontsize=9, color="#0f172a")
ax.set_ylim(-0.16, 0.16); ax.set_yticks([])
ax.set_xlabel("value")
ax.set_title(f"Range and IQR   n={n}, range={rng:g}, IQR={iqr:g}")
ax.legend(frameon=False, fontsize=9, loc="upper left")
ax.spines[["top", "right", "left"]].set_visible(False)
fig.tight_layout()
fig.savefig("range.png", dpi=150)
print("saved range.png")

Actual output from running the script

n = 12   min = 45   max = 63
RANGE           = 18
inclusive range = 19   (max - min + 1, for whole numbers)
midrange        = 54
Q1, Q3          = 48.7500, 56.5000   IQR = 7.7500   semi-IQR = 3.8750
5th to 95th     = 46.1000 to 61.9000   range = 15.8000
trim one each end: 18 -> 14  (22.2% of the range gone)
range / IQR     = 2.3226   (2 to 4 is typical for normal data)

d2(12)          = 3.258455
SD from range   = 5.524090   actual SD = 5.670231   error 2.6%
range / 4 rule  = 4.500000

SPC at n=5: d2=2.3259  d3=0.8641  D3=0.0000  D4=2.1145  A2=0.5768

THE RANGE GROWS WITH SAMPLE SIZE:
  n = 2     expected range = 1.1284 sigma
  n = 5     expected range = 2.3259 sigma
  n = 10    expected range = 3.0775 sigma
  n = 30    expected range = 4.0855 sigma
  n = 100   expected range = 5.0152 sigma
  n = 1000  expected range = 6.4829 sigma

Line-by-line explanation

  • Block 2 computes every variant. Note that np.percentile defaults to linear interpolation, which matches Excel's QUARTILE.INC and R's type 7, so the three tools agree out of the box for once.
  • Block 3 measures fragility by trimming one observation from each end. On this data the range falls 22.2%, which is unremarkable. Above 50% you have a problem.
  • Block 4 computes d₂ by integrating rather than looking it up, so it works for any n. The estimate of 5.5241 lands within 2.6% of the true standard deviation of 5.6702, from two numbers rather than twelve.
  • Block 5 derives the control chart constants. At the standard subgroup size of 5 it produces D₄ = 2.1145 and A₂ = 0.5768, which are exactly the values printed on every SPC reference card.
  • The final loop is the one worth reading twice. It prints the expected range at six sample sizes, climbing from 1.13 standard deviations at n = 2 to 6.48 at n = 1,000. Nothing about the population changed between those rows.

Useful one-liners

TaskPythonNote
The rangenp.ptp(x)"peak to peak", the name nobody guesses
Also the rangex.max() - x.min()clearer, and no overflow surprise
Minimum and maximumx.min(), x.max()
Inclusive rangenp.ptp(x) + 1whole numbers only
Midrange(x.max() + x.min()) / 2
Interquartile rangestats.iqr(x)SciPy, linear by default
IQR from NumPynp.subtract(*np.percentile(x,[75,25]))note the reversed order
IQR, other conventionsstats.iqr(x, interpolation='midpoint')several methods available
Percentile rangenp.ptp(np.percentile(x,[5,95]))
Pandas rangedf['x'].max() - df['x'].min()no built-in range method
Range by groupdf.groupby('g')['x'].agg(lambda v: v.max()-v.min())
Range of every columndf.max() - df.min()vectorised across columns
Ignore missing valuesnp.nanmax(x) - np.nanmin(x)pandas skips NaN by default
Trimmed rangenp.ptp(np.sort(x)[1:-1])drops one from each end
Rolling rangedf['x'].rolling(5).apply(np.ptp)
Everything at oncedf.describe()gives min and max but not the range
Cross-checking. All three languages agree on the range itself, which is unusual. They also agree on the interquartile range as long as you stay with the default linear interpolation in each. The disagreements start when you switch quartile conventions, so if an IQR does not match between tools, check the method before checking the data.

📋 11. Reference Tables

11.1 The d₂ and d₃ constants, and every control chart factor built from them

This is the table that makes the range genuinely useful rather than merely simple. d₂ is the expected range of n values drawn from a normal distribution with a standard deviation of 1, so dividing your observed range by it gives an unbiased estimate of σ. d₃ is the standard deviation of the range itself, and the chart factors follow from the two.

nd₂d₃D₃D₄A₂Efficiency
21.12840.85250.00003.26651.8800100%
31.69260.88840.00002.57461.023399%
42.05880.87980.00002.28200.728698%
52.32590.86410.00002.11450.576896%
62.53440.84800.00002.00380.483293%
72.70440.83320.07571.92430.419391%
82.84720.81980.13621.86380.372589%
92.97000.80780.18401.81600.336787%
103.07750.79700.22301.77700.308385%
113.17290.78730.25561.74440.285182%
123.25850.77850.28331.71670.265882%
133.33600.77040.30721.69280.249478%
143.40680.76300.32811.67190.235478%
153.47180.75620.34661.65340.223178%
163.53200.74990.36301.63700.212372%
173.58790.74400.37791.62210.202872%
183.64010.73860.39131.60870.194372%
193.68900.73350.40351.59650.186672%
203.73490.72870.41471.58530.179672%
213.77830.72420.42501.57500.173367%
223.81940.71990.43451.56550.167567%
233.85830.71590.44341.55660.162167%
243.89530.71210.45161.54840.157267%
253.93060.70840.45931.54070.152667%
How to use this table. To estimate a standard deviation, divide your range by d₂. To build a range chart, multiply the average range by D₃ and D₄ for the lower and upper limits. To build an X-bar chart, take the grand mean plus and minus A₂ times the average range. The efficiency column tells you how much information you give up compared with computing the standard deviation directly.

Note that D₃ is exactly zero for n below 7. That is not a rounding artefact: the lower three-sigma limit for the range falls below zero at those subgroup sizes, and a range cannot be negative, so the limit is clipped. This is why range charts with small subgroups appear to have no lower control limit.

11.2 How the range grows with sample size

The single most important table on this page. Every row describes the same underlying population; only the sample size changes.

Sample sizeExpected rangeRelative to n = 10range / 4 as a % of the truthVerdict
21.1284 σ37%28%under by 72%
31.6926 σ55%42%under by 58%
42.0588 σ67%51%under by 49%
52.3259 σ76%58%under by 42%
62.5344 σ82%63%under by 37%
82.8472 σ93%71%under by 29%
103.0775 σ100%77%under by 23%
153.4718 σ113%87%under by 13%
203.7349 σ121%93%under by 7%
253.9306 σ128%98%about right
304.0855 σ133%102%over by 2%
504.4981 σ146%112%over by 12%
1005.0152 σ163%125%over by 25%
2005.4921 σ178%137%over by 37%
5006.0734 σ197%152%over by 52%
10006.4829 σ211%162%over by 62%
Two things to take from this table. First, a sample of 1,000 will show a range roughly twice that of a sample of 10 drawn from the identical population, so comparing ranges across different sample sizes is meaningless. Second, the familiar range-over-four rule is only accurate for n somewhere around 25 to 30, where d₂ happens to pass through 4. At n = 5 it returns 58% of the correct standard deviation, and at n = 1,000 it returns 162%.

11.3 The measures of spread compared

MeasureFormulaUses how many values?Breakdown pointGrows with n?
Rangemax − min20%Yes, substantially
Interquartile rangeQ3 − Q1about half25%No
Semi-IQR(Q3 − Q1) ÷ 2about half25%No
10 to 90 percentile rangeP90 − P10about 80%10%Very slightly
Standard deviation√[Σ(x−x̄)²/(n−1)]all0%No
MADmedian of |x − median|all50%No
Midrange(max + min) ÷ 220%Not applicable, it is a centre

Breakdown point is the fraction of the data that can be arbitrarily corrupted before the statistic becomes meaningless. The range and the midrange both have a breakdown point of zero: one bad value is enough. The MAD tolerates half the data being wrong.

11.4 Range as a multiple of the interquartile range

A useful diagnostic. For normal data this ratio rises slowly with sample size, so a value well above the expected figure points to long tails or an outlier.

Sample sizeTypical range / IQR for normal dataWhat a much higher value suggests
10about 2.3one extreme value
20about 2.8one or two extreme values
50about 3.3heavy tails, or a mixture of two groups
100about 3.7heavy tails or skew
500about 4.5genuine long tails
1,000about 4.8genuine long tails

These are approximate because the IQR of a normal distribution is 1.349σ, so the expected ratio is simply d₂ divided by 1.349. At n = 12 that gives 3.258 / 1.349 = 2.4, against the 2.32 actually observed in the worked example.

11.5 Which range to report

SituationReportWhy
Continuous measurements, describing a spanPlain rangeIt is a distance
Counting whole values in a spanInclusive rangeBoth endpoints count
Data are skewedInterquartile rangeThe range hides which tail is long
Outliers are plausibleInterquartile rangeThe range is entirely determined by them
Comparing groups of different sizesIQR, or size-adjusted rangeRaw ranges are not comparable
Quality control with small subgroupsPlain range, plus d₂Fast, and nearly as efficient as the SD
Tolerance or specification limitsPlain rangeThe extremes are the point
Talking to a general audience"From X to Y"Immediately understood
Feeding a statistical formulaPlain rangeNever the inclusive version

11.6 The same calculation in three tools

TaskExcelRPython
MinimumMIN(r)min(x)x.min()
MaximumMAX(r)max(x)x.max()
RangeMAX(r)-MIN(r)diff(range(x))np.ptp(x)
Midrange(MAX(r)+MIN(r))/2mean(range(x))(x.max()+x.min())/2
IQRQUARTILE.INC(r,3)-QUARTILE.INC(r,1)IQR(x)stats.iqr(x)
PercentilePERCENTILE.INC(r,0.9)quantile(x,.9)np.percentile(x,90)
Named "range" function?None existsYes, but returns two numbersYes, called ptp
Default quartile methodLinear (INC)Type 7, linearLinear
Read the last two rows. Excel has no range function at all. R has one that returns the minimum and maximum rather than their difference, which is the single most common R beginner error on this topic. Python has one but calls it ptp, which almost nobody finds. On the plus side, all three default to the same quartile convention, so interquartile ranges do agree across tools.

💡 12. Eight Worked Examples

Every number below was computed with the calculator on this page and cross-checked against Python. Each example has its own colour and its own figure. Examples 3 and 4 are the two worth studying: one shows a single typo multiplying the range by 32, the other shows two samples from similar populations appearing to differ by a factor of nearly three purely because of their sizes.

1📝 Example 1, The Basic Calculation and Its Variants

Setup: 52, 48, 55, 61, 47, 58, 50, 63, 45, 56, 54, 49

IQR 7.75min 45max 63range = 18Exam marks, n = 12range 18, IQR 7.75
Figure 1. Every observation plotted, with the full range as the pale band and the interquartile range as the darker inner bar.
n12
Minimum45
Maximum63
Range63 − 45 = 18
Inclusive range18 + 1 = 19
Midrange(63 + 45) ÷ 2 = 54
Q1, Q348.75, 56.50
Interquartile range7.75
Range / IQR ratio2.3226
Mean for comparison53.1667

Reading it: The range of 18 is the distance from the lowest mark to the highest. The inclusive range of 19 is the number of possible whole marks in that span, and which you want depends on whether you are measuring a distance or counting possibilities. Notice how much narrower the interquartile range is: the middle half of the class sits within 7.75 marks, less than half the full spread. The range-to-IQR ratio of 2.32 is unremarkable for twelve observations, so no single mark is stretching the result.

2🔢 Example 2, When the Plus One Matters

Setup: The same marks, 45 to 63. How wide is the span, and how many marks does it cover?

18Plain range(a distance)19Inclusive range(a count)1DifferenceTwo correct answers to two different questionsmarks from 45 to 63
Figure 2. The quantities compared directly, drawn to scale.
Question AHow far apart are the best and worst marks?
Answer A18 marks apart
Question BHow many different whole marks are possible in that span?
Answer B19 possible marks
Why they differboth endpoints are counted in B, only the gap in A
The classic analogya 10 m fence with posts every metre needs 11 posts
Use plain fortemperature, weight, time, any statistical formula
Use inclusive formarks, days, dice faces, anything counted

Reading it: Neither answer is wrong, and confusing them is the fencepost error. Days 1 to 7 of a study span a distance of 6 days but cover 7 days of observation. The rule that matters in practice: any statistical formula, including the d2 estimator on this page, wants the plain range. Feeding it an inclusive range inflates the result, and the error is proportionally largest on small numbers, where the extra 1 is a big share of the total.

3🚨 Example 3, One Typo Destroys the Range

Setup: 52, 48, 55, 61, 47, 58, 50, 63, 45, 56, 54, 49, 630

IQR 9min 45max 630range = 585The same marks with 63 mistyped as 630range 585, but 97% of it is one value
Figure 3. Every observation plotted, with the full range as the pale band and the interquartile range as the darker inner bar.
n13
Minimum45
Maximum630 (should be 63)
Range585
Range without the typo18
Range after trimming one at each end16
Drop from trimming97.3%
Interquartile range9.00
Range / IQR ratio65.0
What the IQR didbarely moved, from 7.75 to 9.00

Reading it: A single misplaced digit multiplies the range by 32. Removing just one value from each end cuts it by 97.3%, which is the clearest possible signal that the statistic is describing one observation rather than a dataset. Note what the interquartile range did: it moved from 7.75 to 9.00 and no further, because the middle half of the data is untouched by anything happening in the tails. This is the entire case for reporting the IQR alongside, and the range-to-IQR ratio of 65 is a red flag no reader could miss.

4📏 Example 4, The Same Spread Looks Twice as Wide

Setup: Two samples drawn from populations with very similar spread: one of 5 values, one of 50.

2510301001000n=5, 2.33 sigman=50, 4.50 sigmaExpected range against sample size, for normal datathe population never changed
Figure 4. The expected range climbing with sample size, on a logarithmic axis.
Small sample43, 45, 49, 56, 61  (n = 5)
Large samplea 50-value set with almost the same spread
Small sample SD7.5631
Large sample SD7.5593
SD ratio1.00, the spread is genuinely identical
Small sample range18
Large sample range28
Range ratio1.56, from sample size alone
d₂ at n = 5 and n = 502.3259 and 4.4981, a ratio of 1.93
Size-adjusted ranges7.739 and 6.225

Reading it: These two samples have essentially identical spread: their standard deviations are 7.5631 and 7.5593, a ratio of 1.00. Yet their ranges are 18 and 28, a ratio of 1.56. That entire difference comes from sample size, because every extra observation is another chance to set a new extreme and the range can only grow with n. It never shrinks. The d₂ constants predict a ratio of 1.93 purely from the sizes, and dividing each range by its own d₂ brings the two figures to 7.74 and 6.23, far closer than 18 against 28 suggested. The adjustment slightly overshoots here because the range of a single five-value sample is itself very variable, which is a second reason to distrust ranges from tiny samples. The practical rule stands: comparing raw ranges across unequal sample sizes always makes the larger sample look more variable, and it is the most common misuse of this statistic.

5⚙ Example 5, Estimating a Standard Deviation on the Factory Floor

Setup: Five parts measured off a production line: 10.02, 9.98, 10.05, 9.96, 10.01 mm.

0.0387d2 estimaterange / 2.3260.0225range / 4 rule0.0351actual SDFive parts measured, range 0.09 mmthe rule of thumb is 42% low here
Figure 5. The quantities compared directly, drawn to scale.
Subgroup size n5
Minimum9.96
Maximum10.05
Range0.09
d₂ for n = 52.3259
Estimated SD0.038694
Actual SD0.035071
Estimation error10.3%
Range / 4 rule0.0225, which is 42% too low
D₄ for n = 52.1145, so the range chart UCL is 0.1903
A₂ for n = 50.5768

Reading it: An operator subtracts two numbers and divides by 2.326. The estimate of 0.0387 lands 10% above the standard deviation of 0.0351 computed properly from all five values, which is about the accuracy you should expect from a single subgroup of this size. At n = 5 the range estimator retains about 96% of the efficiency of the full calculation, which is why Shewhart built control charts around it in the 1920s and why they still work this way. Note that the range-over-four rule gives 0.0225 here, 42% too low, because d2 at n = 5 is 2.326 rather than 4. The rule of thumb silently assumes a sample size nobody ever states.

6📈 Example 6, Three Quartile Conventions, Three Answers

Setup: The same twelve exam marks, with the interquartile range computed three ways.

7.75LinearExcel INC, R type 78.50Tukey hingesMoore and McCabe9.25ExclusiveExcel EXC, R type 6The same twelve marks, three IQRsnone is wrong
Figure 6. The quantities compared directly, drawn to scale.
Linear interpolation Q1, Q348.75, 56.50
Linear IQR7.75
Tukey hinges Q1, Q348.50, 57.00
Tukey IQR8.50
Exclusive Q1, Q348.25, 57.50
Exclusive IQR9.25
Spread between methods1.50 marks
The plain range18 under every method
Excel defaultQUARTILE.INC, the linear method
R defaulttype 7, also the linear method

Reading it: The interquartile range is 7.75, 8.50 or 9.25 depending on which convention you use, a spread of 1.5 marks on identical data. None is wrong; they interpolate differently between the two observations straddling each quartile. The plain range is 18 under all three, because minima and maxima need no interpolation, which is one genuine advantage of the range over the IQR: it is completely unambiguous. If an IQR you compute disagrees with someone elses, check the method before you check the arithmetic.

7📊 Example 7, Grouped Data Cannot Give One Answer

Setup: Ages in five classes: 0 to 10 (3 people), 10 to 20 (7), 20 to 30 (12), 30 to 40 (6), 40 to 50 (2).

50Boundary range0 to 5040Midpoint range5 to 4510The uncertaintyTwo defensible answers from the same tablethe truth is between them
Figure 7. The quantities compared directly, drawn to scale.
Total frequency30
Classes5
Class width10
Lowest boundary0
Highest boundary50
Boundary range50
Lowest midpoint5
Highest midpoint45
Midpoint range40
Uncertainty10 years
If the top class were open-endedno range could be computed at all

Reading it: Grouping records which class each person fell into and discards their actual age. The youngest person is somewhere between 0 and 10, the oldest somewhere between 40 and 50, so the true range is anywhere from 30 to 50. The boundary method assumes both sat exactly on the outer edges, which is the most extreme case; the midpoint method assumes the average case and gives 40. The midpoint estimate is usually the more honest one, but say which you used, because a reader cannot tell from the number. And if the top class had been 40 and over, there would be no maximum and no range at all.

8🧩 Example 8, When the Range Tells You Almost Nothing

Setup: 22, 25, 27, 28, 31, 33, 34, 36, 39, 42, 48, 55, 71, 96, 180 (thousands)

IQR 22min 22max 180range = 158Household income, strongly right-skewed, n = 15range 158 but the middle half spans 22
Figure 8. Every observation plotted, with the full range as the pale band and the interquartile range as the darker inner bar.
n15
Minimum22
Maximum180
Range158
Interquartile range22.00
Range / IQR ratio7.2
10th to 90th percentile range60.20
Median36.00
Mean51.13
Skewness2.62, strongly right-skewed
Range after trimming one each end71

Reading it: The range says incomes span 158 thousand. The interquartile range says the middle half of households sit within 22 thousand of each other. Both are true and they describe completely different realities. The range treats both ends alike, so it entirely conceals the fact that this distribution has a short left tail and a very long right one. The range-to-IQR ratio of 7.2 is far above the 2 to 4 expected for symmetric data, which is the diagnostic. For skewed data like this, report the median with the interquartile range, and quote the range only if the extremes are themselves the point.

📋 13. Data Collection Protocol

The range is built from the two most extreme observations, which are exactly the values most likely to be errors. That single fact should shape how you collect and check data whenever a range is going to be reported.

  1. Verify both extremes against the original record. Not the spreadsheet, the original. A misplaced decimal or a transposed digit lands at one end of the sorted data and controls the entire result, as Example 3 shows.
  2. Fix the sample size in advance if you intend to compare groups. The range grows with n, so unequal sample sizes make any comparison meaningless. Equal n is the only clean solution.
  3. Record the sample size alongside every range you report. A range without n cannot be interpreted or compared with anything.
  4. Use one measurement protocol throughout. Mixing instruments or conditions widens the extremes with measurement noise that has nothing to do with the quantity you are studying.
  5. Watch for values at a detection or instrument limit. Readings recorded as "below detection" or capped at a maximum truncate the tails and understate the range, sometimes dramatically.
  6. Never record missing data as zero. A zero becomes your minimum and the range balloons. Blanks are excluded; zeros are not.
  7. Record raw values at full resolution. Rounding compresses the extremes and shrinks the range, and coarse rounding can make several values tie at the minimum or maximum.
  8. Decide plain or inclusive before you start. It depends on whether you are measuring a distance or counting whole values, and the decision belongs in the protocol rather than being made at the reporting stage.
  9. Avoid open-ended categories if a range will be needed. A top class of "60 and over" makes the maximum unknowable and the range uncomputable.
  10. Plot the data before summarising it. A dot plot takes seconds and immediately reveals whether the extremes sit close to the rest or far out on their own.
  11. Report the interquartile range alongside whenever skew or outliers are plausible, which is most of the time.
  12. For quality control, keep subgroups small and consistent. Four or five is standard, because that is where the range is nearly as efficient as the standard deviation and the d₂ constant stays stable.
The failure that ruins the most ranges. Pooling measurements taken under different conditions. If half your readings came from one instrument and half from another with a slight offset, the extremes will come from opposite instruments and the range will measure the calibration gap rather than the natural variation. Record the conditions, then check whether the range within each condition is much smaller than the range overall.

🎯 14. When to Use the Range, and When Not To

Use the range when

  • The extremes are the point. Tolerance limits, worst-case planning, safety margins and specification checks all care about the boundaries rather than the typical case.
  • You are running quality control with small subgroups. At n = 4 or 5 the range is roughly as informative as the standard deviation and vastly faster to compute by hand.
  • Your audience is non-technical. "Between 4 and 19 degrees" needs no explanation to anyone.
  • You are sanity-checking new data. An impossible minimum or maximum exposes a data-entry error faster than any other statistic.
  • The sample is genuinely tiny. Below about n = 6 you lose very little by using the range instead of the standard deviation.
  • You need something completely unambiguous. Unlike quartiles, the range has no competing conventions: every tool agrees on the minimum and maximum.

Do not rely on the range when

  • You are comparing groups of different sizes. This is the big one. The range grows with n, so the comparison is contaminated before you start.
  • Outliers are plausible and unverified. One bad value controls the result completely, and the range gives you no warning.
  • The data are skewed. The range treats both tails alike and hides the fact that one is far longer than the other.
  • You have a large sample. With 1,000 observations the range is determined by two of them and ignores 998. That is an enormous waste of information.
  • The data are ordinal. The distance between rank 1 and rank 5 is not a meaningful quantity.
  • You need a measure that supports further analysis. Almost nothing in inferential statistics is built on the range, whereas the standard deviation is the foundation of most of it.
  • Values may be censored or capped. A truncated tail makes the range meaningless rather than merely imprecise.

What to use instead

SituationBetter choiceWhy
Comparing groups of unequal sizeInterquartile range or standard deviationNeither grows systematically with n
Outliers presentInterquartile rangeIgnores the tails entirely
Skewed dataMedian with quartilesShows which tail is long
Large samplesStandard deviationUses every observation
You want a robust spread in original units1.4826 × MADBreakdown point of 50%
Ordinal dataFrequencies or the range of ranksArithmetic on ranks is not meaningful
Quality control with larger subgroupsS charts rather than R chartsThe range loses efficiency above about n = 10
Reporting uncertainty in an estimateConfidence intervalThe range describes data, not estimates
Reference intervals in medicine2.5th to 97.5th percentile rangeStable, and excludes the extreme 5%

🔧 15. Troubleshooting

SymptomCauseFix
R's range(x) gave two numbersThat function returns the minimum and maximum, not their differenceUse diff(range(x)) or max(x)-min(x)
You cannot find a RANGE function in ExcelThere isn't one; "range" means a block of cells=MAX(r)-MIN(r)
You cannot find a range function in NumPyIt is called np.ptp, for "peak to peak"Or just x.max()-x.min()
np.ptp returned a negative numberInteger overflow on a small dtypeCast to float first, or use max minus min
Your answer is one more than expectedYou used the inclusive rangeDrop the +1 for distances and for any formula
Your answer is one less than expectedYou needed the inclusive rangeAdd 1 when counting whole values in a span
The range is enormousOne value in the wrong unit, or a typo adding a digitSort the data and inspect both extremes
The range is zeroEvery value is identicalCorrect, but check for rounding or copy errors
Group A looks far more variable than group BGroup A probably has more observationsCompare IQRs, or divide each range by its d₂
Your IQR does not match a colleague'sDifferent quartile conventionLinear, Tukey and exclusive give 7.75, 8.50 and 9.25 on the same data
The plain range matches but the IQR does notSame cause. Minima and maxima need no interpolationAgree on a quartile method
SD estimated from the range is badly wrongYou divided by 4 instead of d₂At n = 5 divide by 2.326, not 4
Grouped range does not match the raw rangeGrouping is an approximationExpected. Report which convention you used
You cannot compute a range at allAn open-ended class such as "60 and over"No maximum exists. Report the closed classes only
Excel included your header rowA numeric header is treated as dataStart the range at the first data row
Missing values were treated as zeroBlanks and zeros behave differentlyLeave missing cells genuinely blank

16. Assumptions and Limitations

What the range assumes

The subtraction itself assumes nothing at all. Everything below is about whether the resulting number means what you want it to mean.

AssumptionHow much it mattersWhat happens if it failsHow to check
Both extremes are genuineCriticalThe range describes a typo rather than your dataVerify the two values against the original record
Sample sizes match, when comparingCriticalThe larger sample always appears more variableCompare n before comparing ranges
Interval or ratio scaleHighThe distance between ordinal codes is not a quantityInspect what the numbers represent
No censoring or cappingHighTruncated tails make the range meaningless, not just impreciseLook for values piled up at a limit
Roughly symmetric, for interpretationModerateThe range hides which tail is longCompare the mean with the median
Normality, for the d₂ estimator onlyModerateThe SD estimate drifts on skewed dataOnly relevant when using d₂
Classes closed, for grouped dataCritical for that modeAn open-ended class makes the range uncomputableCheck the first and last classes
Correct variant chosenModerateOff by exactly 1, which is proportionally large on small numbersDistance or count?

Limitations worth stating in a write-up

  • It uses two observations and discards the rest. With 1,000 values, 998 have no influence. No other common statistic throws away so much.
  • It grows with sample size. This is unique among measures of spread and it makes cross-group comparison invalid unless n matches.
  • Its breakdown point is zero. A single corrupted value destroys it, and the statistic itself gives no signal that this happened.
  • It says nothing about shape or centre. Data clustered tightly with two stragglers and data spread evenly give the identical range.
  • It has no sampling theory worth using. There is no standard confidence interval for a range in routine practice, and almost no inferential procedure is built on it.
  • The range-over-four rule is tied to an unstated sample size. It returns 58% of the correct standard deviation at n = 5 and 162% at n = 1,000.
  • Grouped ranges are ambiguous by construction. Two defensible answers exist and the data cannot distinguish between them.
  • The midrange is even more fragile than the range. As a measure of centre it has a breakdown point of zero, which is why the mean and median exist.
Why the range survives despite all of this. It is instantly computable, needs no formula, is understood by everyone, has no competing conventions, and at small sample sizes it is genuinely efficient. In quality control, where subgroups are small and speed matters more than the last few percent of statistical efficiency, it remains the right tool a century after Shewhart chose it.

🏁 17. Conclusion

The range is the largest value minus the smallest. It is the first measure of spread anyone learns, it needs no formula, and it is expressed in the same units as the data. For describing a span to a general audience, for checking new data for impossible values, and for quality control with small subgroups, it remains genuinely the right choice.

Three variants are worth keeping straight. The plain range is a distance and is what every statistical formula expects. The inclusive range adds one and counts how many whole values a span covers, which is the right answer when you are counting marks or days rather than measuring a gap. The interquartile range describes the middle half and is the robust alternative to reach for whenever the extremes cannot be trusted.

Two properties of the range cause almost all of the trouble. The first is that it rests on exactly two observations, which are precisely the values most likely to be typos. Example 3 on this page shows a single misplaced digit multiplying the range by 32, with 97% of the result disappearing when one value is trimmed from each end. The interquartile range, over the same data, barely moved. That contrast is the entire argument for reporting both.

The second property is the one almost nobody mentions and it is the reason this page exists. The range grows with sample size. It is the only common measure of spread that does, because every additional observation is another chance to set a new extreme and the range can never decrease. For normal data the expected range climbs from 1.13 standard deviations at n = 2 to 3.08 at n = 10, 5.02 at n = 100 and 6.48 at n = 1,000, with the population unchanged throughout. Example 4 shows two samples whose standard deviations agree to two decimal places producing ranges that differ by more than half. Comparing raw ranges across groups of different sizes is therefore not a rough approximation, it is a systematic error that always makes the larger sample look more variable.

That same relationship, read the other way, is what makes the range useful in manufacturing. Divide by the d₂ constant for your subgroup size and you have an unbiased estimate of the standard deviation from two numbers and a division. At n = 5 that estimate retains roughly 96% of the efficiency of the full calculation, which is why Shewhart built control charts on it in the 1920s and why D₃, D₄ and A₂ still appear on every SPC reference card. Note that the familiar range-over-four shortcut is a special case of this that quietly assumes n is somewhere around 25; at n = 5 it returns 58% of the correct answer.

So: report the range with its sample size, always. Give the minimum and maximum rather than just the difference, because readers want to know where the span sits. Verify both extremes before you publish. Add the interquartile range whenever skew or outliers are plausible. And never, under any circumstances, compare the range of one group against the range of another unless the two samples are the same size.

18. Frequently Asked Questions

What is the range in statistics?
The range is the largest value in your data minus the smallest. For the marks 45, 47, 50, 55 and 63 the range is 63 minus 45, which is 18. It measures how far apart the two extremes are, in the same units as your data, and it is the simplest measure of spread there is.
How do you calculate the range?
Find the maximum, find the minimum, subtract. That is the whole calculation. In Excel it is =MAX(range)-MIN(range), in R it is diff(range(x)) and in Python it is np.ptp(x) or simply x.max()-x.min(). No sorting is strictly necessary, though sorting makes the extremes easy to eyeball.
What is the difference between the range and the inclusive range?
The plain range is a distance: 63 minus 45 is 18. The inclusive range adds one and counts how many whole values the span covers: there are 19 possible marks from 45 to 63 because both endpoints count. Use the plain range for continuous measurements and for any statistical formula, and the inclusive range when you are counting whole units such as marks, days or dice faces.
Why does the range increase with sample size?
Because every additional observation is another chance to exceed the current maximum or fall below the current minimum. The range can only stay the same or grow; it can never shrink. For normal data the expected range rises from 1.13 standard deviations at n = 2 to 3.08 at n = 10 and 6.48 at n = 1,000, with no change in the underlying population. This is unique among common measures of spread, and it is why ranges from different sample sizes cannot be compared.
Can I compare the range of two groups?
Only if the two samples are the same size. If one group has 50 observations and the other has 10, the larger group will show a wider range even when the populations are identical, by roughly 46% on average. Compare the interquartile ranges instead, or the standard deviations, or divide each range by its own d₂ constant to put them on a common footing. The compare tab on this page does that automatically and warns you when the sizes differ.
Why is Excel's range function missing?
Because in Excel the word "range" already means a block of cells, so the statistical function was never given that name. You compute it yourself with =MAX(A2:A13)-MIN(A2:A13). There is no hidden function to find.
Why does R's range() function give two numbers?
R's range(x) returns a vector containing the minimum and the maximum, not the difference between them. To get the range as a single number use diff(range(x)) or max(x)-min(x). Assigning r <- range(x) and then treating r as a scalar is the most common R error on this topic, and it fails silently rather than raising an error.
What is np.ptp in Python?
It is NumPy's range function, and the name stands for "peak to peak". Almost nobody guesses that, so most people write x.max() - x.min() instead, which is clearer and avoids one real hazard: on small integer types np.ptp can overflow silently. np.ptp(np.array([-128,127], dtype=np.int8)) returns −1 rather than 255, because 255 does not fit in an int8.
What is the midrange?
The midrange is the average of the minimum and the maximum, (max + min) divided by 2. It is a measure of centre rather than of spread, and it is extremely fragile: a single outlier moves it without limit, so its breakdown point is zero. It is occasionally useful for symmetric bounded data or for a quick mental estimate, but the mean and the median are almost always better.
Is the range affected by outliers?
More than any other common statistic. The range is defined entirely by the two most extreme observations, which are precisely the values most likely to be data-entry errors. In Example 3 on this page a single mistyped digit multiplies the range by 32. The calculator reports how much the range falls when you trim one value from each end, and a drop above 50% means two observations are controlling the whole result.
What is the difference between the range and the interquartile range?
The range covers everything from the smallest value to the largest. The interquartile range covers only the middle half, from the 25th to the 75th percentile. Because the IQR ignores both tails, no single extreme value can change it and it is far more stable across different sample sizes. On the twelve exam marks the range is 18 and the IQR is 7.75, describing the same data at very different levels of caution.
How do I estimate the standard deviation from the range?
Divide the range by d₂, a constant that depends only on the sample size: 2.326 at n = 5, 3.078 at n = 10, 3.931 at n = 25. This gives an unbiased estimate for normal data. The full table is in section 11.1. Do not use the range-over-four rule unless your sample size is around 25, because that is the only place where d₂ happens to be near 4.
Why is the range rule of thumb SD equals range over 4?
Because d₂ passes through 4 somewhere around n = 25 to 30, so for middling samples dividing by 4 is close. Outside that window it drifts badly: at n = 5 it returns 58% of the correct standard deviation and at n = 1,000 it returns 162%. The rule is not wrong so much as tied to a sample size that nobody states when quoting it. Use it as a sanity check, not as a reported figure.
What are d₂, D₃, D₄ and A₂?
They are the constants behind X-bar and R control charts. d₂ is the expected range of n normal values with a standard deviation of 1, so range divided by d₂ estimates sigma. d₃ is the standard deviation of the range itself. D₃ and D₄ multiply the average range to give the control limits for a range chart, and A₂ multiplies it to give the limits for an X-bar chart. Section 11.1 tabulates all of them for n from 2 to 25.
Why is D₃ zero for small subgroups?
Because the lower three-sigma limit for the range would fall below zero at those sample sizes, and a range cannot be negative. The limit is therefore clipped to zero, which is why range charts with subgroups of six or fewer appear to have no lower control limit. D₃ becomes positive from n = 7 onwards.
Can the range be zero or negative?
Zero yes, negative never. A range of zero means every value is identical, which is arithmetically correct but usually indicates rounding, copying, or a measurement resolution too coarse to see the real variation. It can never be negative because the maximum is by definition at least as large as the minimum. If software gives you a negative range, you have hit an integer overflow.
How do I find the range of grouped data?
You cannot find it exactly, only bound it. Using the outer class boundaries gives the widest the range could be; using the outer class midpoints gives a more conservative estimate. For classes running from 0 to 50, those give 50 and 40 respectively, and the true range lies somewhere between. The midpoint version is usually the more honest choice, but say which you used. If any class is open-ended, no range can be computed at all.
Is the range a good measure of spread?
It depends entirely on your sample size and your purpose. For small subgroups in quality control it is excellent, retaining about 96% of the efficiency of the standard deviation at n = 5. For large samples it is poor, because it uses two observations and ignores the rest. For comparing groups of unequal size it is actively misleading. And whenever outliers are plausible it is the least reliable option available.
What is a percentile range?
A trimmed range that cuts off the most extreme values at each end. A 10th to 90th percentile range discards the top and bottom tenth, and a 5th to 95th discards the top and bottom twentieth. The 25th to 75th percentile range is exactly the interquartile range. Trimming buys stability at the cost of discarding genuine information, and reference intervals in medicine commonly use the 2.5th to 97.5th percentile range for this reason.
Why does my interquartile range not match someone else's?
Almost certainly a different quartile convention. Linear interpolation (Excel's QUARTILE.INC, R's type 7), Tukey's hinges and the exclusive method (QUARTILE.EXC, R type 6) give 7.75, 8.50 and 9.25 on the same twelve values. None is wrong; they interpolate differently between the observations straddling each quartile. The plain range, by contrast, is identical under every method, because minima and maxima need no interpolation.

🔖 19. Cite This Tool

APA 7th
StatsUnlock. (2026). Descriptive Statistics Range Calculator [Online tool]. https://statsunlock.com/range-calculator/
MLA 9th
"Range Calculator." StatsUnlock, 2026, statsunlock.com/range-calculator/.
Chicago
StatsUnlock. "Range Calculator." Accessed 2026. https://statsunlock.com/range-calculator/.
BibTeX
@misc{statsunlock_range, title={Descriptive Statistics Range Calculator}, author={{StatsUnlock}}, year={2026}, url={https://statsunlock.com/range-calculator/}}

🔗 20. Related Calculators

📖 21. Glossary

TermMeaning
RangeMaximum minus minimum. A distance, in the units of the data.
Inclusive rangeMaximum minus minimum plus one. Counts how many whole values a span covers.
MidrangeThe average of the minimum and maximum. A measure of centre, not spread.
Interquartile range (IQR)Q3 minus Q1, the spread of the middle half.
Semi-interquartile rangeHalf the IQR. Also called the quartile deviation.
Percentile rangeA trimmed range, such as the 10th to 90th percentile.
QuartileA value cutting the data at 25%, 50% or 75%.
Tukey hingesOne convention for quartiles, using the medians of the two halves.
Breakdown pointThe fraction of data that can be corrupted before a statistic fails. Zero for the range.
OutlierA value far from the rest. It determines the range entirely.
d₂The expected range of n normal values with a standard deviation of 1.
d₃The standard deviation of the range itself.
D₃, D₄Multipliers giving the control limits for a range chart.
A₂The multiplier giving X-bar chart limits from the average range.
R chartA control chart plotting subgroup ranges over time.
X-bar chartA control chart plotting subgroup means, usually paired with an R chart.
SubgroupA small sample taken at one time for quality control, typically four or five items.
EfficiencyHow much information an estimator extracts relative to the best available one.
Statistical process controlMonitoring a process using control charts, where the range is still widely used.
Range rule of thumbSD approximately equals range divided by 4. Only accurate near n = 25.
Grouped dataA frequency table. Ranges from it are approximate.
Class boundaryThe stated edge of a class interval.
Class midpointThe centre of a class interval.
Open-ended classA class such as "60 and over", which makes the range uncomputable.
Fencepost errorConfusing a count of items with the gaps between them. The source of the plus-one confusion.
Censored dataValues recorded only as above or below a limit, which truncates the range.
Trimmed rangeThe range after removing a fixed number of values from each end.

📚 22. References

  1. Shewhart, W. A. (1931). Economic Control of Quality of Manufactured Product. Van Nostrand. archive.org
  2. Tippett, L. H. C. (1925). On the extreme individuals and the range of samples taken from a normal population. Biometrika, 17(3-4), 364-387. doi.org/10.1093/biomet/17.3-4.364
  3. Pearson, E. S. (1932). The percentage limits for the distribution of range in samples from a normal population. Biometrika, 24(3-4), 404-417. doi.org/10.1093/biomet/24.3-4.404
  4. Hartley, H. O. (1942). The range in random samples. Biometrika, 32(3-4), 334-348. doi.org/10.1093/biomet/32.3-4.334
  5. David, H. A., & Nagaraja, H. N. (2003). Order Statistics (3rd ed.). Wiley. doi.org/10.1002/0471722162
  6. Duncan, A. J. (1986). Quality Control and Industrial Statistics (5th ed.). Irwin. archive.org
  7. Montgomery, D. C. (2020). Introduction to Statistical Quality Control (8th ed.). Wiley. wiley.com
  8. Wheeler, D. J., & Chambers, D. S. (2010). Understanding Statistical Process Control (3rd ed.). SPC Press. spcpress.com
  9. American Society for Quality (2019). ASQ Control Chart Constants. asq.org
  10. Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley. archive.org
  11. Hyndman, R. J., & Fan, Y. (1996). Sample quantiles in statistical packages. The American Statistician, 50(4), 361-365. doi.org/10.1080/00031305.1996.10473566
  12. Moore, D. S., McCabe, G. P., & Craig, B. A. (2021). Introduction to the Practice of Statistics (10th ed.). W. H. Freeman. macmillanlearning.com
  13. Wan, X., Wang, W., Liu, J., & Tong, T. (2014). Estimating the sample mean and standard deviation from the sample size, median, range and interquartile range. BMC Medical Research Methodology, 14, 135. doi.org/10.1186/1471-2288-14-135
  14. Hozo, S. P., Djulbegovic, B., & Hozo, I. (2005). Estimating the mean and variance from the median, range, and the size of a sample. BMC Medical Research Methodology, 5, 13. doi.org/10.1186/1471-2288-5-13
  15. Gumbel, E. J. (1958). Statistics of Extremes. Columbia University Press. archive.org
  16. Harter, H. L. (1960). Tables of range and studentized range. Annals of Mathematical Statistics, 31(4), 1122-1147. doi.org/10.1214/aoms/1177705684
  17. Huber, P. J., & Ronchetti, E. M. (2009). Robust Statistics (2nd ed.). Wiley. doi.org/10.1002/9780470434697
  18. Harris, C. R., et al. (2020). Array programming with NumPy. Nature, 585, 357-362. doi.org/10.1038/s41586-020-2649-2
  19. Virtanen, P., et al. (2020). SciPy 1.0: Fundamental algorithms for scientific computing in Python. Nature Methods, 17, 261-272. doi.org/10.1038/s41592-019-0686-2
  20. R Core Team (2024). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing. r-project.org
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Important Plots & Charts

Most Popular