Tabellab
Business & operations

Cp and Cpk formula in Excel, with a worked example

Cp and Cpk tell you whether a process can make parts inside the specification limits. Cp compares the tolerance width with the process spread, Cp = (USL − LSL) ÷ 6σ. Cpk also checks where the process is centred, Cpk = MIN(USL − mean, mean − LSL) ÷ 3σ. In Excel that is =(USL-LSL)/(6*sigma) and =MIN(USL-mean,mean-LSL)/(3*sigma). In the example below, a shaft with a tolerance of 25.000 ± 0.050 mm has a Cp of 1.66 but a Cpk of only 1.05: the spread is fine, the process runs off-centre.

Updated 21 Oct 2026 5 min read By Tabellab team

The Cp and Cpk formulas

Cp = (USL − LSL) ÷ (6 × σ)

Cpk = MIN(USL − mean, mean − LSL) ÷ (3 × σ)

USL and LSL are the upper and lower specification limits, the tolerance the customer allows. About 99.73% of a normal process lies within ±3σ of its mean, so 6σ is the natural width of the process. Cp asks how many times that width fits into the tolerance, as if the process were perfectly centred. Cpk measures the distance from the mean to the nearer limit in units of 3σ, so it punishes an off-centre process. Cpk can never be higher than Cp, and the two are equal only when the mean sits exactly in the middle of the tolerance.

Step 1: which σ? Within versus overall

Cp and Cpk use the within-subgroup standard deviation, the short-term noise of the process. With data in rational subgroups, small samples taken close together, estimate it from the average range: σ within = R-bar ÷ d2. The constant d2 depends on the subgroup size: 1.128 for 2, 1.693 for 3, 2.059 for 4 and 2.326 for 5.

The example measures three shafts every hour for eight hours. The ranges average 0.0170 mm, so σ within = 0.0170 ÷ 1.693 = 0.0100 mm. The overall standard deviation of all 24 values, =STDEV.S(B2:D9), is slightly larger at 0.0112 mm because it also contains the drift between the hours. That one is used for Pp and Ppk, the long-term performance indices.

Step 2: Cp, Cpk, Pp and Ppk in Excel

With the limits in B11 and B12, the mean in B13 and the two sigmas in B16 and B17:

  • =(B12-B11)/(6*B16) gives Cp = 1.66
  • =(B12-B13)/(3*B16) and =(B13-B11)/(3*B16) give the upper side Cpu = 1.05 and the lower side Cpl = 2.27
  • =MIN(B19,B20) gives Cpk = 1.05
  • the same formulas with the overall σ give Pp = 1.49 and Ppk = 0.94

The mean is 25.0183 mm, 0.018 mm above the nominal 25.000. The process is precise enough (Cp 1.66), but it sits too close to the upper limit, so Cpk is far below Cp. Re-centring the process on 25.000 mm would bring Cpk up to the Cp of 1.66 without any other improvement. That is usually the cheapest fix in quality work: an offset adjustment, not a new machine.

Worked example: capability of a machined shaft diameter

Eight subgroups of three shafts, one subgroup per hour. Specification 25.000 ± 0.050 mm. Measurements and limits are yellow inputs, every result is a formula.

Worked example: capability of a machined shaft diameter
ABCDE
1Subgroupx1 (mm)x2 (mm)x3 (mm)Range (mm)
2Hour 125.02425.00725.0170.017
3Hour 225.01125.02925.0200.018
4Hour 325.03625.01925.0300.017
5Hour 425.00225.01424.9980.016
6Hour 525.02125.03525.0160.019
7Hour 625.01525.00325.0200.017
8Hour 725.02725.03925.0240.015
9Hour 825.01225.00125.0180.017
10
11LSL (mm)24.950
12USL (mm)25.050
13Mean of all 24 values25.0182
14R-bar (average range)0.0170
15d2 for subgroups of 31.693
16σ within = R-bar ÷ d20.0100
17σ overall = STDEV.S0.0112
18Cp1.66
19Cpu (upper side)1.05
20Cpl (lower side)2.27
21Cpk1.05
22Pp1.49
23Ppk0.94
24Expected ppm above USL (within σ)784
Key formulas
  • E2=MAX(B2:D2)-MIN(B2:D2)Range of one subgroup
  • B16=B14/B15Within-subgroup σ from the average range
  • B17=STDEV.S(B2:D9)Overall σ of all values
  • B18=(B12-B11)/(6*B16)Cp: tolerance width ÷ 6σ
  • B21=MIN(B19,B20)Cpk: the worse of the two sides
  • B23=MIN(B12-B13,B13-B11)/(3*B17)Ppk with the overall σ

Fictional data for teaching. Real capability studies need a stable process, a capable gauge and enough data, often 100 or more values.

What is a good Cpk?

A Cpk of 1.00 means the nearer limit is exactly 3σ from the mean, about 1,350 parts per million outside on that side. A Cpk of 1.33 means 4σ, about 32 ppm. Common targets are Cpk ≥ 1.33 for an existing process and 1.67 for new or safety-critical characteristics, and a Six Sigma process has Cp = 2.0. Customers often write their own minimum into the supplier agreement, so check that first.

For the shaft, the upper side at Cpu = 1.05 implies about 784 ppm above the USL, =(1-NORM.S.DIST(3*B19,TRUE))*1000000. The lower side contributes practically nothing.

Check stability and normality first

Capability indices only mean something for a stable process. If the process shifts from hour to hour, a capability number describes a moment, not a process. Plot an X-bar and R control chart before you report Cpk, and look at the shape of the data with a histogram in Excel: the ppm estimates assume a roughly normal distribution. A large gap between Cpk and Ppk, like 1.05 against 0.94 here, is itself a signal that the process drifts over time.

Sample size matters too. Twenty-four values are enough to learn the method, but a capability study for a customer usually needs more, often 100 or more measurements in at least 20 to 25 subgroups, to keep the estimate of σ reasonably stable.

Common mistakes

  • Using STDEV.S of all data for Cpk. That is the overall σ and gives Ppk. Cp and Cpk use the within-subgroup σ, such as R-bar ÷ d2.
  • Dividing by 6σ in Cpk. Cpk looks at one side of the distribution, so it divides by 3σ. Cp divides the whole tolerance by 6σ.
  • Taking MAX instead of MIN. Cpk is the worse side. Using the better side hides an off-centre process.
  • Reporting Cpk for an unstable process. Check a control chart first. Capability is a property of a stable process.
  • Using the wrong d2. d2 depends on the subgroup size: 1.693 for subgroups of 3, 2.326 for 5.
  • Trusting a capability study on a poor gauge. If the measurement system eats up much of the tolerance, run a gage R&R before believing any Cpk.

Frequently asked questions

What is the difference between Cp and Cpk?

Cp compares the tolerance width with the process spread and ignores where the process is centred. Cpk uses the distance from the mean to the nearer limit, so it falls when the process drifts off-centre. Cpk equals Cp only for a perfectly centred process.

How do you calculate Cpk in Excel?

Put the limits, the mean and σ in cells and use =MIN(USL-mean,mean-LSL)/(3*sigma). For σ, use R-bar divided by d2 from subgrouped data, or STDEV.S of all values if you want Ppk instead.

What is a good Cpk value?

A Cpk of at least 1.33 is a common target for an existing process, 1.67 for new or critical characteristics. Below 1.00 the process produces a noticeable share of parts outside the limits.

What is the difference between Cpk and Ppk?

Both use the same formula. Cpk uses the short-term, within-subgroup σ, Ppk the overall standard deviation of all values. Ppk includes drift between subgroups, so it is usually lower.

Practise it in a lab

Related guides

Reading is step one. Doing is step two.

Every guide links to a lab where you build the same calculation in an online spreadsheet and get instant feedback.

Open the lab