How to Calculate Cpk in Excel (Step-by-Step Formulas), and a Faster Way

By Josh Brook on October 21, 2026

cpk-in-excel

Excel has no built-in CPK function, but you can build Cpk in Excel yourself in about 10 minutes with a few standard formulas. This guide gives copy-ready formulas for individual values and for subgroups, shows the one mistake that quietly turns Cpk into Ppk, and lists what Excel will not check for you. For the math behind each step, see the Cpk formula.

Process capability Excel guide

Build a Cpk sheet in about 10 minutes

Name a few cells, type a few formulas and you have a working capability sheet. The formulas below use named cells, so they read the way you would say them out loud.

Named cells used on this page
LSLE1
USLE2
Mean=AVERAGE(A2:A101)
Sigma=MRbar/1.128
Cpk=MIN(Cpu,Cpl)

What you need before you start

Every Cpk formula Excel needs for this is listed below in copy-ready form. Get these three things in place first, and the rest is typing.

Data in production orderValues must stay in the sequence the parts were made. Sorting them breaks the moving range and the subgroups.
Spec limitsLSL in E1 and USL in E2, taken from the drawing.
Enough dataAbout 25 subgroups or 100 individual values from a steady run.
How to name a cell: click the cell, type the name in the Name Box to the left of the formula bar, and press Enter. Do this for LSL, USL and each result cell as you go.

Cpk in Excel for individual values

Use this when you measure one part at a time. Put 100 values in A2:A101, in production order, with LSL in E1 and USL in E2.


A
B
C
D
E
1
Value
Moving range

LSL
lower limit
2
first value


USL
upper limit
3
next value
=ABS(A3-A2)

Mean
=AVERAGE(A2:A101)
4
next value
=ABS(A4-A3)

Sigma
=MRbar/1.128
…
…
…

Cpk
=MIN(Cpu,Cpl)
101
last value
=ABS(A101-A100)



  1. Calculate the mean. Name the cell Mean.
    =AVERAGE(A2:A101)
  2. Add the moving range. In B3, then fill down to B101.
    =ABS(A3-A2)
  3. Average the moving ranges. Name the cell MRbar.
    =AVERAGE(B3:B101)
  4. Estimate the within sigma. Name the cell Sigma.
    =MRbar/1.128
  5. Calculate Cpu and Cpl. Name the cells Cpu and Cpl.
    =(USL-Mean)/(3*Sigma)
    =(Mean-LSL)/(3*Sigma)
  6. Take the smaller as Cpk.
    =MIN(Cpu,Cpl)
  7. Add Cp for comparison.
    =(USL-LSL)/(6*Sigma)

Cpk in Excel for subgroups

Use this when you measure several parts at a time, for example 5 consecutive parts every hour. Put one subgroup of 5 per row in B2:F26, which gives 25 subgroups.

  1. Find the range of each row. In G2, then fill down to G26.
    =MAX(B2:F2)-MIN(B2:F2)
  2. Average the ranges. Name the cell Rbar.
    =AVERAGE(G2:G26)
  3. Calculate the grand mean. Name the cell Mean.
    =AVERAGE(B2:F26)
  4. Estimate the within sigma. 2.326 is the d2 constant for subgroups of 5. Name the cell Sigma.
    =Rbar/2.326
  5. Finish with the same formulas. Cpu, Cpl, Cpk and Cp are exactly as in the individuals sheet above, because they only read the named cells.

d2 constants for other subgroup sizes

If your subgroups are not 5 parts, swap 2.326 for the value that matches your size.

Subgroup size (n)
2
3
4
5
6
7
8
9
10
d2
1.128
1.693
2.059
2.326
2.534
2.704
2.847
2.970
3.078

The STDEV.S mistake: it gives Ppk, not Cpk

The most common shortcut is to run STDEV.S across every value and use that as sigma. It looks reasonable, and it is a real index, just not Cpk. STDEV.S gives the overall spread, which includes every shift between subgroups. Plug it in and you get Ppk.

For Cpk

Within sigma, from the moving range or R-bar.

=MRbar/1.128
=Rbar/2.326
For Ppk

Overall sigma, from every value. Name it SigmaAll.

=STDEV.S(A2:A101)

If you do want Ppk, keep it on purpose and label it. The Ppk Excel formula is the same as Cpk, with the overall sigma swapped in:

=MIN((USL-Mean)/(3*SigmaAll),(Mean-LSL)/(3*SigmaAll))

Reporting both side by side is useful, because the gap shows how much your process moves over time. The full explanation is in Cpk vs Ppk.

Skip the sheet on your next study

Get Cp, Cpk, Pp and Ppk from your own data: paste your measurements and get a one-page capability report. 14-day free trial, no card needed.

Paste from Excel
Cp · Cpk · Pp · Ppkin one report

What Excel won't check for you

The formulas will always return a number. Whether that number means anything is a separate question, and the spreadsheet will not ask it.

01

Stability

Cpk assumes the process runs steady. You need a control chart to confirm that, and building one in Excel is a project of its own.

02

Normality

The formulas assume roughly normal data. Excel will not warn you about a skewed or bimodal distribution. Check a histogram first.

03

Enough data

Excel happily returns a Cpk from 12 values. Aim for about 25 subgroups or 100 values before you rely on the result.

04

Every new data set

New study, new ranges, new fill-downs and new chances for a broken reference. Each one means redoing the sheet.

Even with a clean sheet, the result still has to be judged against your customer's target. For typical targets, see what a good Cpk value looks like.

A faster way

Once you know how to calculate Cpk in Excel, you also know how much copying, filling and checking each new study takes. Paste the same column into the Cp/Cpk Report Generator and get Cp, Cpk, Pp, Ppk, expected PPM, a histogram, a control chart, a normality check and a one-page PDF. Treat the result as an estimate to review, like any capability study.

Paste straight from ExcelNo reformatting needed
Your layoutOne value per line or one subgroup per row
All checks in one goCpk, Ppk, histogram, control chart and normality check
Ready to shareOne-page PDF
Same data, no formulas to maintain

Get Cp, Cpk, Pp and Ppk from your own data: paste your measurements and get a one-page capability report. 14-day free trial, no card needed.

Sheet vs report
Formulas to buildNone
Control chartIncluded
Normality checkIncluded
OutputOne-page PDF

Frequently asked questions

Does Excel have a built-in Cpk function?

No. Excel has no CPK function, so you build it from standard formulas: AVERAGE for the mean, ABS or MAX and MIN for the ranges, a d2 constant or 1.128 for the within sigma, and MIN to pick the smaller of Cpu and Cpl. With named cells, the whole sheet takes about 10 minutes.

Why doesn't my Excel result match my SPC software?

The most common reason is sigma. If you used STDEV.S across all values, you calculated Ppk, not Cpk. Other causes are values out of production order, a different subgroup size than the d2 constant you used, or the software using a different within-sigma method. Check those first.

Should I use STDEV.S or STDEV.P for Ppk?

Use STDEV.S. It treats your data as a sample from the process, which is what a capability study is. STDEV.P assumes you measured every part the process will ever make. With about 100 values the difference is small, but STDEV.S is the standard choice for the overall sigma.

What if my subgroups are not 5 parts?

Keep the same steps and change only the d2 constant in the within-sigma formula. For example, use 1.128 for subgroups of 2, 2.059 for subgroups of 4 or 3.078 for subgroups of 10. Every subgroup should be the same size, and the MAX and MIN range should cover the full row.

How many values do I need in the sheet?

Aim for about 25 subgroups or 100 individual values, kept in production order and taken from a steady run. Fewer values give a rough sigma, so Cpk can swing a lot from one study to the next. Check a control chart before you report the result to anyone.


Share This Story, Choose Your Platform!