How to Calculate Cpk in Excel

Excel has no built-in Cpk function, but four formulas get you there. Put your readings in subgroups, one row each. Find the mean with =AVERAGE, the subgroup ranges with =MAX−MIN, and the average range R̄. Divide R̄ by the d₂ constant (2.326 for subgroups of 5) to estimate within-subgroup sigma. Then Cpk = MIN(USL − mean, mean − LSL) ÷ (3 × sigma). Swap in =STDEV.S of all readings and the same formula gives Ppk. The steps below give the exact cells, and the Example works one through.

By Coplain Team

Last updated

Step by step

  1. Lay out the data in subgroups — put each subgroup on its own row in time order, one reading per column. With subgroups of 5, readings go in B2:F2, the next subgroup in B3:F3, and so on. Keep units consistent and make sure every cell is a number, not text pasted from a gauge export.
  2. Enter the specification limits — type the lower limit in J1 and the upper limit in J2, taken from the drawing in the same units as the data. For a one-sided tolerance, enter only the limit that exists.
  3. Calculate each subgroup range — in G2 enter =MAX(B2:F2)-MIN(B2:F2) and fill it down to the last subgroup. The ranges measure short-term, part-to-part variation.
  4. Calculate the mean and both sigmas — grand mean in J3: =AVERAGE(B2:F26). Overall sigma in J4: =STDEV.S(B2:F26). Average range in J5: =AVERAGE(G2:G26). Within-subgroup sigma in J6: =J5/2.326, where 2.326 is d₂ for subgroups of 5. Use the d₂ for your subgroup size (1.128 for 2, 1.693 for 3, 2.059 for 4).
  5. Calculate Cpk and Ppk — Cpk in J7: =MIN(J2-J3,J3-J1)/(3*J6). Ppk in J8: =MIN(J2-J3,J3-J1)/(3*J4). Optionally Cp in J9: =(J2-J1)/(6*J6). Check the answer against the process capability calculator.
  6. Chart the data before you report the number — plot the subgroup means and ranges as an X̄-R chart in time order. If points fall outside the control limits or the means drift, the process is not stable and Cpk does not predict future output. The SPC guide explains how to read the chart.

What the formula is doing

Cpk asks how many three-sigma widths fit between the process mean and the nearer specification limit. A Cpk of 1.0 means the nearer limit sits exactly three sigma from the mean. A Cpk of 1.33 means four sigma, and 1.67 means five. Because it uses the nearer limit, Cpk drops when the process drifts off center even if the spread stays the same.

The only judgement call is which sigma to use. The range method in the steps estimates within-subgroup sigma, which is what Cpk is meant to use. Running =STDEV.S over every reading gives the overall sigma, which belongs in Ppk. Cpk vs Ppk explains why the two numbers drift apart and what the gap tells you.

Alternatives for the within-subgroup sigma

The R̄/d₂ method is fine for subgroups up to about 8. For larger subgroups, use the average subgroup standard deviation instead: put =STDEV.S(B2:K2) in each row, average the column, and divide by the c₄ constant for your subgroup size (0.9400 for 5, 0.9727 for 10). Both constants are tabulated in the AIAG SPC manual and in Montgomery’s textbook.

If you only have individual readings with no natural subgroups, use the moving range. Put =ABS(B3-B2) next to each reading from the second one on, average those moving ranges, and divide by 1.128.

Estimating parts per million out of spec

For a stable, roughly normal process you can turn the result into an expected reject rate. In Excel: =(1-NORM.DIST(J2,J3,J4,TRUE))+NORM.DIST(J1,J3,J4,TRUE) returns the fraction outside both limits. Multiply by 1,000,000 for ppm. The DPMO and sigma calculator does the same conversion. Treat the number as an estimate: the tails of real data rarely follow the normal curve exactly.

Where the result goes

Automotive customers expect capability results in the PPAP submission and on the control plan for special characteristics. The PPAP guide shows where the study fits, and the IATF 16949 control plan template has columns for the characteristic, the method and the reaction plan. Read your customer’s supplier manual for the minimum index they require. 1.33 for ongoing production is common, and many initial studies require 1.67.

Before the capability study, check the gauge. Measurement noise adds to both sigmas and pulls Cpk down. How to run a gauge R&R study walks through that check.

Worked examples

Example: A turned pin with diameter 25.00 ± 0.10 mm, so LSL = 24.90 and USL = 25.10 (fictional data). Five subgroups of 5 parts were measured, so the Excel ranges end at row 6 instead of 26. Subgroup 1: 25.03, 25.01, 25.03, 25.02, 25.00. Subgroup 2: 25.02, 25.05, 25.03, 25.01, 25.04. Subgroup 3: 25.00, 25.02, 24.99, 25.04, 25.01. Subgroup 4: 25.04, 25.06, 25.03, 25.05, 25.03. Subgroup 5: 25.01, 25.00, 25.02, 25.00, 25.03.

  1. Ranges in G2:G6 = 0.03, 0.04, 0.05, 0.03, 0.03
  2. Grand mean =AVERAGE(B2:F6) = 25.0228 mm
  3. Overall sigma =STDEV.S(B2:F6) = 0.01815 mm
  4. R̄ =AVERAGE(G2:G6) = 0.18 ÷ 5 = 0.036 mm
  5. Within sigma = 0.036 ÷ 2.326 = 0.01548 mm
  6. Nearer limit: USL − mean = 25.10 − 25.0228 = 0.0772 mm (mean − LSL = 0.1228 mm is farther)
  7. Cpk = 0.0772 ÷ (3 × 0.01548) = 0.0772 ÷ 0.04643 = 1.66
  8. Ppk = 0.0772 ÷ (3 × 0.01815) = 0.0772 ÷ 0.05444 = 1.42
  9. Cp = 0.20 ÷ (6 × 0.01548) = 2.15

Result: Cpk is 1.66 and Ppk is 1.42. Cp of 2.15 shows the spread would fit comfortably if the mean were centered at 25.00, so re-centering the process by about 0.02 mm would raise Cpk more than any reduction in variation. Subgroup 4 runs higher than the others, which explains part of the gap to Ppk. Five subgroups are too few for a real study; collect 25 or more before reporting.

Common mistakes

Frequently asked questions

Does Excel have a Cpk function?

No. Excel has no CPK or PPK function. Build it from AVERAGE, STDEV.S, MAX and MIN as shown in the steps, or use an add-in. The formulas are simple enough that a sheet you build yourself is easy to audit.

What is d₂ and where does 2.326 come from?

d₂ is a constant that converts an average range into a standard deviation estimate for a normal process. It depends on subgroup size. 2.326 is the value for subgroups of 5, and the full table is in SPC references such as the AIAG SPC manual.

How do I calculate Cpk with only an upper limit?

Use only the side that exists: Cpk = (USL − mean) ÷ (3 × within sigma). In Excel that is =(J2-J3)/(3*J6). Cp is not defined for a one-sided tolerance.

Why is my Cpk higher than my Ppk?

Within-subgroup sigma only sees short-term variation, while the overall sigma also includes shifts between subgroups. A Cpk above Ppk is normal. A large gap means something moves the process between subgroups.

Can I use Excel’s Data Analysis ToolPak instead?

The ToolPak’s Descriptive Statistics gives the mean and the sample standard deviation, which is enough for Ppk. It does not compute a within-subgroup sigma, so you still need the range or s̄/c₄ step for Cpk.

Sources

  1. Statistical Process Control (SPC) Reference Manual, 2nd edition, AIAG
  2. Introduction to Statistical Quality Control, Douglas C. Montgomery, Wiley
  3. NIST/SEMATECH e-Handbook of Statistical Methods, section 6.1.6 Process Capability, NIST
  4. STDEV.S function, Microsoft Support
  5. ISO 22514-2, Statistical methods in process management — Capability and performance — Part 2, ISO

See also

COPLAIN AI PLATFORM

Generate yours automatically from your existing docs

Coplain turns your control plan and inspection procedures into clear, numbered work instructions, so the people collecting capability data measure the same way every time.

Generate yours automatically with Coplain →

Related Tools & Templates