Template · Industrial engineering

X-bar and R control chart calculator (SPC)

Control limits, sigma estimate, Cp and Cpk, and out-of-control flags for subgroup measurements.

Create an account

Downloads are included in the $19.85 yearly membership. Sign in

XLSXCSVODSXMLNumbers
X-bar and R control chart calculator (SPC)
Example data — replace the blue input cells with your own.
X-DOUBLE-BAR (MM)R-BAR (MM)CPKPOINTS OUT OF CONTROL
25.0020.0421.832
Inputs
Subgroup size (n)5The Samples tab holds 5 measurements per subgroup. Use a size from 2 to 5.
Upper specification limit (USL, mm)25.10
Lower specification limit (LSL, mm)24.90
Constants for n (from the Constants tab)
A2 (X-bar limit factor)0.577
D3 (lower R limit factor)0.000
D4 (upper R limit factor)2.114
d2 (sigma estimate factor)2.326

Showing the first 16 of 39 rows and 4 of 4 columns. Cells with formulas show the formula on hover.

What does this template do?

An X-bar and R chart tracks a process over time by plotting the average and the range of small samples, called subgroups. This workbook is for quality engineers and production supervisors who monitor a dimension and need control limits and a capability figure.

The Samples tab holds subgroups of five measurements with their dates. For each subgroup the sheet calculates the mean and the range. The Summary tab computes the grand mean, the average range, the X-bar limits (grand mean plus or minus A2 times the average range) and the R limits (D4 and D3 times the average range). It estimates sigma as R-bar divided by d2, then gives Cp and Cpk from the specification limits.

Each subgroup is flagged when its mean or range falls outside the limits. The factors come from the Constants tab for subgroup sizes 2 to 10. The example data is fictional: 25 subgroups of a machined shaft diameter, with two subgroups outside the limits.

What’s inside

  • X-bar and R control limits from the average range and Shewhart factors
  • Flags for each subgroup mean and range outside its limits
  • Sigma estimated as R-bar divided by d2
  • Cp and Cpk from the specification limits
  • Constants table for subgroup sizes 2 to 10

Which tabs does the workbook have?

TabWhat it holds
SummaryInputs, the constants for n, control limits, capability and out-of-control counts.
SamplesSubgroup measurements with the mean, range and control flags for each subgroup.
ConstantsShewhart control chart factors for subgroup sizes 2 to 10.
NotesWhat the workbook does, the formulas in words, assumptions and limits.

What formulas does this template use?

This template holds 323 formulas in 635 cells across 4 tabs, so 51% of its cells calculate. They use 13 distinct functions; the longest formula is 272 characters and 111 of them read from another tab.

FunctionUsesWhat it does
IF912one result when a test is true, another when false
ISNUMBER100true for a number
NOT100reverses true and false
AVERAGE52mean of numbers
COUNT51counts numeric cells
MIN51smallest value
AND50true when every test is true
MAX50largest value
OR8true when any test is true
COUNTIF5counts cells meeting one condition
IFERROR4swaps an error for a fallback value
VLOOKUP4looks a value up in a column

The 12 most used of 13 functions. Counted from the workbook itself. Only functions that Excel, LibreOffice Calc, Google Sheets and Apple Numbers evaluate the same way are used, so the formulas survive every download format.

How do you use it?

  1. Enter the subgroup size and the upper and lower specification limits on the Summary tab.
  2. Type subgroup numbers, dates and measurements on the Samples tab, up to 50 subgroups.
  3. Read the control limits, sigma estimate and capability on the Summary tab.
  4. Check the Status column on the Samples tab for subgroups outside the limits.
  5. Investigate each flagged subgroup before you recalculate the limits.

What is it good for?

  • Monitoring a machined dimension at the start of each shift
  • Setting trial control limits from the first 25 subgroups
  • Reporting Cpk for a critical dimension
  • Teaching the X-bar and R chart method

Questions about this sheet

What are the control limits based on?

The X-bar limits are the grand mean plus or minus A2 times the average range. The R limits are D4 and D3 times the average range. The factors come from the Constants tab for the subgroup size you enter.

Why does the sheet flag a point that is inside the specification limits?

Control limits describe the variation of the process, and specification limits describe what the customer accepts. A point can sit inside the specification and still outside the control limits, which signals a change in the process.

Is Cpk reliable with few subgroups?

It rests on the sigma estimate from the average range, so it is only as reliable as the data behind it. Confirm that the process is stable before you rely on Cpk.

What subgroup sizes does the sheet support?

The Samples tab has five measurement columns, so the subgroup size must be from 2 to 5 here. The Constants tab lists factors up to size 10 for reference.