Quality Excel Templates

Cpk vs Ppk in Excel: the exact formulas, and what the gap means

Worked with an X-bar & R chart, subgroup size n = 5.

Cp and Cpk use within-subgroup variation. Pp and Ppk use the overall standard deviation of every reading. That single difference is why the two pairs disagree — and the size of the disagreement is itself a diagnostic.

The two sigmas

Everything follows from which standard deviation you put in the denominator.

NameSigma usedHow it is estimatedWhat it describes
Cp, CpkσwithinR̄ ÷ d2 Short-term spread — how tight the process is inside a subgroup
Pp, PpksSample standard deviation of all readings Long-term spread — everything, including drift between subgroups

Step 1 — the inputs

Assume 25 subgroups of 5 readings in B2:F26, with the spec limits in named cells USL and LSL.

Subgroup average   G2:  =AVERAGE(B2:F2)
Subgroup range     H2:  =MAX(B2:F2)-MIN(B2:F2)

Grand average      Xbb: =AVERAGE(B2:F26)
Average range      Rbar:=AVERAGE(H2:H26)
Overall std dev    s:   =STDEV.S(B2:F26)
Use STDEV.S, not STDEV.P. Ppk is defined on the sample standard deviation (divisor n−1). STDEV.P will quietly inflate your Ppk.

Step 2 — within-subgroup sigma

d2 depends only on the subgroup size:

n2345678910
d21.1281.6932.0592.3262.534 2.7042.8472.9703.078
sigma_within (n=5):  =Rbar/2.326

Step 3 — the four indices

Cp   =(USL-LSL)/(6*sigma_within)
Cpk  =MIN((USL-Xbb)/(3*sigma_within),(Xbb-LSL)/(3*sigma_within))

Pp   =(USL-LSL)/(6*s)
Ppk  =MIN((USL-Xbb)/(3*s),(Xbb-LSL)/(3*s))

Cp and Pp ignore where the process is centred; Cpk and Ppk do not. That is why Cp can look healthy while Cpk is poor — the spread is fine, the aim is off.

While you are here: the control limits

The same R̄ drives the X-bar and R chart limits, through a different pair of constants.

nA2D3D4
21.88003.267
31.02302.574
40.72902.282
50.57702.114
60.48302.004
70.4190.0761.924
X-bar UCL  =Xbb + 0.577*Rbar      X-bar LCL  =Xbb - 0.577*Rbar
R UCL      =2.114*Rbar            R LCL      =0*Rbar        (n=5)

Reading the gap

What you seeWhat it usually meansWhere to look
Cpk ≈ PpkThe process is stable over the study periodNothing — this is the healthy case
Cpk ≫ PpkTight within subgroups, but the mean moved between them Setup changes, tool wear, shift handover, material lots
Cpk ≈ Ppk, both lowGenuinely wide common-cause variation The process itself, not a special event
Ppk > CpkUnusual. Often a subgrouping mistake Are your subgroups rational? Consecutive parts, one stream?

The gap is the point. A capability number on its own tells you whether today's output fits the spec; the gap between Cpk and Ppk tells you whether that number will survive next week. This is also why you should not report capability from an out-of-control chart — if the chart shows special causes, σwithin is estimating a process that does not exist as a single stable population.

A worked case

The sample data shipped in our SPC template is 25 subgroups of 5, with a deliberate excursion inserted at subgroups 18 and 19. Those two points flag as out of control on the X-bar chart, and the capability sheet returns Cpk 2.59 against Ppk 1.58.

Nothing is wrong with the arithmetic. Within any single subgroup the process is extremely tight, so σwithin is small and Cpk is flattering. The overall standard deviation has to absorb the excursion as well, so Ppk drops. Reporting the 2.59 alone would describe a process that was, in fact, disturbed twice during the study.

Template

All of the above is wired up in the SPC Control Chart Excel template — X-bar & R charts with automatic limits, out-of-control flagging, and the capability sheet. Plain .xlsx worksheet formulas, so every constant above is visible in the cells and you can change the subgroup size without touching any code.

Related