# Calculating LCL, UCL, Cp, and Cpk in an Excel Spreadsheet

#### TarKEpa

##### Registered
Hi All;

Kindly I need to make sure from my calculation in the attached sheet

1. I'm calculating the UCL and LCL for Product Overall Yield (Pharmaceutical), I used I-MR chart,

2. then, calculate Cp and Cpk. (This is before Improvement)

============================================================

1. I got rid of (Out-of-Specs) and (Out-of-Control) points,

2. then, calculate again new UCL and LCL using the old UCL and LCL as a new USL and LSL,

3. then, calculate Cp and Cpk again (after Improvement)

My Questions:
1. Did I use the correct control chart?
2. Am I right in my steps to calculate UCL and LCL before and after improvement?
3. Am I right in calculating Cp and Cpk before and after improvement? and If, Why Cp and Cpk before improvement is higher than after?????

#### Attachments

• Calculating LCL UCL Cp and Cpk.xls
299 KB · Views: 3,663
Last edited:

#### Bev D

##### Heretical Statistician
Super Moderator
First you calculate the control limits without removing out of spec points. There is no statistical or physics foundation for doing this. removing points that are out of specification should never be done.

Second the removal of out of control points for the calculation of control limits is not normally necessary although it can be done carefully. It is usually OK if you are only removing one or two that you know the assignable cause for. otherwise you might get control limits that are just too narrow to be useful...

Certainly you never remove OOC or Out of Spec points when calculating capability including Cp/Cpk indices...

However, in this case the control limits calculated with all of the data are more valuable as they demonstrate that you have an unstable process - normally, this would preclude the usefulness of any Cp or Cpk calculation (beyond their inherent useless properties)

Technically the data you are plotting is categorical data so your calculation of the standard deviation (for Cp/Cpk) is incorrect as you used the continuous data formula. However, Yields are weird data and this approach is probably close enough for an estimate...

HOWEVER, why? Specifications on Yields are silly. They aren't specifications in the real sense of the term, they are really goals. (and an upper goal on yield means nothing) It might be nice to understand the capability of the process yield vs. the desired yield goal, but Cp and Cpk only confuse the matter. A simple control chart with control limits and the minimum goal should suffice and it will provide far more insight than a simple index ever can. If you need some quantification of the capability a simple calculation of the proportion of times the process exceeds the goal will suffice and it is probably far more understandable to those who care than Cp/Cpk will be.

By the way, you shouldn't smooth the line on the charts. While those who don't know anything about data will think it's 'pretty', a smoothed line implies that there is data between the plotted data points and in this case there isn't. graphical design standards are to use a simple straight line between the points to display the time series...

#### TarKEpa

##### Registered
Thanks Bev, I really appreciate that, but excuse me I will try to understand each point separately.
and generally, I need to know, with this data collection, what do you prefer which types of control charts can I use? and how can I calculate CLs?

First you calculate the control limits without removing out of spec points. There is no statistical or physics foundation for doing this. removing points that are out of specification should never be done.

Yes Bev, I do that (In my first chart), I calculate the CL without removing out-of-specs points using 2 sigma (X bar (+)(-) mR bar * 1.77).

My specs are 80% lower and 105% upper.

Second the removal of out of control points for the calculation of control limits is not normally necessary although it can be done carefully. It is usually OK if you are only removing one or two that you know the assignable cause for. otherwise you might get control limits that are just too narrow to be useful...

In 2nd chart, I already removed out-of-specs & OOC, otherwise how can I Improve my process? I wonder?
If I have LCL= 91.6% (in 1st chart using 2 sigma), How can I raise or narrow this limit (I need to reduce scrap in process) without removing any of outliers points?

Certainly you never remove OOC or Out of Spec points when calculating capability including Cp/Cpk indices...

However, in this case the control limits calculated with all of the data are more valuable as they demonstrate that you have an unstable process - normally, this would preclude the usefulness of any Cp or Cpk calculation (beyond their inherent useless properties)

Technically the data you are plotting is categorical data so your calculation of the standard deviation (for Cp/Cpk) is incorrect as you used the continuous data formula. However, Yields are weird data and this approach is probably close enough for an estimate...

HOWEVER, why? Specifications on Yields are silly. They aren't specifications in the real sense of the term, they are really goals. (and an upper goal on yield means nothing) It might be nice to understand the capability of the process yield vs. the desired yield goal, but Cp and Cpk only confuse the matter. A simple control chart with control limits and the minimum goal should suffice and it will provide far more insight than a simple index ever can. If you need some quantification of the capability a simple calculation of the proportion of times the process exceeds the goal will suffice and it is probably far more understandable to those who care than Cp/Cpk will be.

Great, so what formula can I use to calculate std. deviation and Cp, Cpk? I have more questions to ask regarding this, but I'm trying to get that point first

By the way, you shouldn't smooth the line on the charts. While those who don't know anything about data will think it's 'pretty', a smoothed line implies that there is data between the plotted data points and in this case there isn't. graphical design standards are to use a simple straight line between the points to display the time series...

You're right,

#### Bev D

##### Heretical Statistician
Super Moderator
I will try to understand each point separately. and generally, I need to know, with this data collection, what do you prefer which types of control charts can I use? and how can I calculate CLs?
As I said in my first response, the I, MR chart is probably the best choice for Yields. (I use it quite successfully for such data). Here is an article by Donald Wheeler on the I,MR chart that I recommend you read: “What About p Charts?” (It’s free, just click the article title, it’s linked to the article)

I calculate the CL without removing out-of-specs points using 2 sigma (X bar (+)(-) mR bar * 1.77).
Whoa. I didn’t check your control limit calculations. ALWAYS use 3-sigma limits. So the I, MR multiplier is 2.66 not 1.77. 3 sigma limits are used because they provide the best balance between false alarms and misses when monitoring data over time. (Control charts aren’t ‘hypothesis test’ so the typical 95% level used for hypothesis tests is NOT appropriate for control charts…) Here is another article by Donald Wheeler that explains why 3-sigma limits are used for control charts: “Why Three-Sigma Limits?” (again it’s free)

My specs are 80% lower and 105% upper.
Your specs are just lines drawn in space…they have no basis in reality. First yields can’t be 105%. Again a minimum GOAL might be necessary for improvement reasons but they are not specifications…

In 2nd chart, I already removed out-of-specs & OOC, otherwise how can I Improve my process? I wonder? If I have LCL= 91.6% (in 1st chart using 2 sigma), How can I raise or narrow this limit (I need to reduce scrap in process) without removing any of outliers points?
I don’t understand this…the only way to improve the process is to actually improve it. Determine the physical causes of yield loss, then eliminate, reduce or control for them such that your yields actually improve. Simply removing data from calculations doesn’t change anything. Those values actually occurred and they will occur again in the future…you can recalculate the control limits once the process actually improves…

…so what formula can I use to calculate std. deviation and Cp, Cpk? I have more questions to ask regarding this, but I'm trying to get that point first
Don’t do it. Cp and Cpk don’t tell you anything. This isn’t a math exercise. This is about physics and thinking.
Just LOOK at the time series chart of Yields with the control limits and THAT tells you directly what the process is doing. You can directly calculate the amount of scrap or the proportion of times the process yields less than the GOAL, if you need a number to quantify this. But Cp and Cpk are not valuable or useful in this situation. Ask yourself what you need to know about this process and then select the best analysis.