X̄-R chart: paste your subgroups, get the chart

Subgroups in, X̄ and R charts out — limits from A₂, D₃ and D₄, run rules evaluated, and the range chart shown first because it decides whether the averages chart can be trusted.

How you build an X̄-R chart in Excel

Two line charts stacked: subgroup means on the first, subgroup ranges on the second, each with three helper columns holding its centre line and limits repeated down every row. The X̄ limits need A₂ and the R limits need D₃ and D₄, all for your subgroup size, none of them available as Excel functions.

The two charts have to be read in the right order and a spreadsheet will not enforce it. If the R chart is out of control the X̄ limits are computed from an unstable R̄ and mean nothing — so a point outside the X̄ limits may be telling you about the range chart rather than about the mean.

Nothing you paste leaves this calculation. It is not stored, not logged and not sent anywhere else — the numbers are computed and returned, and that is all. Paste straight out of a spreadsheet — tab-separated columns are understood as they land.

One subgroup per line, values separated by spaces, commas or tabs. Paste straight out of a spreadsheet: a header row is skipped and decimal commas are understood.

What an X̄-R chart is actually doing

Two charts, read together. The X̄ chart plots the average of each subgroup and asks whether the process centre is moving. The R chart plots the range within each subgroup — largest minus smallest — and asks whether the spread is moving. They fail in different ways and they mean different things, which is why nobody should read one without the other.

Read the R chart first. The X̄ chart's limits are computed from R̄, so if the range chart is out of control the limits on the averages chart were calculated from an unstable estimate of variation and cannot be trusted. Investigating a point on the X̄ chart while the R chart is in chaos is chasing an artefact.

The formulas, with your own numbers

Limits on the averages chart are X̿ ± A₂R̄, and on the range chart D₄R̄ and D₃R̄. A₂, D₃ and D₄ depend only on the subgroup size and are lookups, not choices — the full table is on the control chart constants page. Below n = 7, D₃ is zero, which is why the range chart on small subgroups has no lower limit: with four readings you cannot get a range small enough to be surprising.

How you subgroup is the whole design

This is the part that decides whether the chart works, and it is not a data-entry question. A subgroup should be a set of parts made under conditions as nearly identical as you can arrange — consecutive pieces, one machine, one operator, one setup. That way the variation within a subgroup is the process's own background noise, and anything that shifts between subgroups shows up as a signal.

Subgroup across the thing you want to detect and the chart goes blind. Take one part from each of four spindles as your subgroup of four, and spindle-to-spindle difference is now inside R̄. It inflates the limits, the X̄ chart goes quiet, and the chart certifies as stable exactly the difference you built it to find. This is the most common way a correctly computed control chart tells you nothing.

When to use X̄-s instead

The range uses two readings and discards the rest, which is a fine trade at n = 4 or 5 and a poor one at n = 10. Once subgroups get large the standard deviation carries meaningfully more information, and the X̄-s chart is the better instrument. Around n = 9 or 10 is the usual crossover.

These limits are computed from this data

Which is right for a one-off look and wrong for monitoring. On a live process you freeze limits to a baseline window when the process was behaving, so that later drift appears as drift. If the limits recompute from the current data — which is what almost every spreadsheet control chart does — a slow shift drags the limits along with it and the chart never signals. It stays reassuringly in control while the process walks away.

What the Excel version will not do

The R chart has to be judged first
X̄ limits derive from R̄. An unstable range makes the mean chart’s limits meaningless, and nothing in a workbook stops you reading them anyway.
Every new subgroup rewrites the limits
Formulas over a growing range recalculate A₂R̄ on each entry, so the limits drift toward whatever the process is doing now instead of holding at what it was doing when it was stable.
Unequal subgroups break the helper columns
One shift that recorded four parts instead of five changes A₂, D₃ and D₄ for that subgroup alone — a case the three-flat-columns approach cannot represent at all.

Questions people ask about this

What is an X bar R chart used for?

Monitoring a measured characteristic when you can take several parts at a time. The X̄ chart tracks whether the process centre is moving; the R chart tracks whether its spread is. Together they separate a process that has shifted from one that has become more variable, which need different responses.

Which chart do I read first, X bar or R?

The R chart, always. The limits on the averages chart are calculated from R̄, so if the range chart is out of control those limits were derived from an unstable estimate of variation and mean nothing. Stabilise the spread, then interpret the centre.

What subgroup size should I use?

Four or five is the classic choice and still a good one. It is large enough for the averages to behave normally regardless of the underlying distribution, and small enough that the range remains an efficient estimator of spread. Above about nine, switch to an X̄-s chart.

How do I calculate X bar R control limits by hand?

Average each subgroup to get X̄ and take its largest minus smallest to get R. Then X̿ ± A₂R̄ gives the limits on the averages chart, and D₄R̄ and D₃R̄ give them on the range chart. A₂, D₃ and D₄ are lookups on subgroup size — the full table is on the control chart constants page.

Why does my chart show no lower limit on the range?

Because D₃ is zero for subgroups below seven. With four or five readings there is no range small enough to be statistically surprising, so a lower limit would be a line no point could ever cross.

How many subgroups do I need?

Twenty to twenty-five before the limits are worth trusting. Fewer will draw a chart, but the limits carry enough uncertainty that both false alarms and missed signals become likely.

Two charts, one reading order, and limits that must not move.

Paste the same subgroups into a workspace: the range chart is judged before the mean chart, the constants are applied for each subgroup’s actual size, and the limits stay frozen at the baseline you locked while new subgroups keep arriving.

More control charts tools

  • Control limit calculator — Give it subgroups or individual readings and it returns the control limits for the chart, the range or sigma chart beneath it, and every constant it used to get there.
  • Control chart generator — Paste a column of numbers, or rows of subgroups, and get a real control chart: limits from the data, Nelson rules 1–4 evaluated, out-of-control points marked.
  • Nelson & Western Electric rules checker — Every run rule evaluated on your data, each violation named in plain English with what it usually indicates — a shift, a trend, tool wear, two machines mixed.
  • X̄-s chart calculator — For subgroups big enough that the range wastes them. Limits from A₃, B₃ and B₄, sigma recovered with the c₄ correction, and the s chart read first because it decides whether the averages chart can be trusted.
  • I-MR chart calculator — For processes that give you one number at a time — a batch, an oven, a destructive test. Limits from the mean moving range, run rules evaluated, and an honest note about what an individuals chart cannot see.
  • p, np, u and c chart calculator — Counted data rather than measured: proportion defective, number defective, defects per unit. Limits that step with the sample size instead of pretending it never changed, and an honest warning when the counts are too low for three-sigma limits to mean anything.

Everything else

  • Cp / Cpk calculator — Paste measurements — or type a mean and a sigma — with your tolerance, and get Cp, Cpk, Pp, Ppk, the sigma level and the expected parts per million out of spec.
  • Cpk confidence interval & sample size — A Cpk of 1.33 from 30 pieces has a 95% interval of roughly 0.97 to 1.69. See the uncertainty in your own number, and how many parts would settle it.
  • Cpk ↔ PPM ↔ sigma level converter — What PPM is a Cpk of 1.33? What Cpk does 3.4 PPM need? Both conventions shown side by side, because the 1.5 sigma shift is why two sources disagree by a factor of ten.
  • Control chart constants — The whole table, n = 2 to 25, with the formula each constant belongs to. The same values the charts on this site are computed from.
  • Levey-Jennings chart with Westgard rules — Paste your QC results with the assigned mean and SD from the package insert, and get the chart with every sigma band drawn and all six Westgard rules evaluated — each one named, and labelled random or systematic error.
  • Bland-Altman plot — Paired readings from two methods, plotted as difference against average — with the bias, the limits of agreement, their confidence intervals, and a test for whether the disagreement depends on the magnitude.
  • Pareto chart generator — Categories and counts in, ranked bars and the cumulative line out — with the vital few named, an "Other" bucket that always sorts last, and an honest warning when the distribution is flat and there is no dominant cause to attack.
  • Box and whisker plot generator — One column per group, boxes side by side. Quartiles, the 1.5×IQR fences, whiskers that stop at real readings and outliers drawn individually — with the quartile method stated, because that is why your plot and Excel's disagree.
  • Histogram and normality test — A histogram with the fitted normal curve, both standard bin rules with a reasoned recommendation, and an Anderson-Darling test that refuses to tell you your data is normal — because no test can.
  • Gage R&R calculator (ANOVA) — Paste a crossed study — part, operator, reading — and get the full ANOVA: repeatability and reproducibility separated, the part-by-operator interaction tested rather than assumed away, %GRR, %Tolerance and ndc against AIAG's bands.
  • Grubbs outlier test — The G statistic against its critical value, the p-value, and the point implicated — plus a straight answer about what to do next, which is almost never to delete the reading.
  • Scatter diagram and correlation — Paired readings plotted, with Pearson r, Spearman rho, r², the least-squares line and its p-value — and the two reported together, because when they disagree the disagreement is the finding.
  • Standard deviation calculator — The usual summary statistics, and the thing a spreadsheet will not tell you: the within-subgroup sigma a control chart uses, beside the overall sigma a textbook means. The gap between them is why Cpk and Ppk disagree.