Build a p chart

Monitor the proportion of nonconforming units when inspection sample sizes vary.

Guides · Process control (SPC) · 4 min read

Example: carton labeling

A distribution center inspects 40 consecutive carton samples of different sizes. Each carton receives one final conforming or nonconforming decision.

Download the carton-labeling example (CSV)

This is the same example used in Help. Each row is one sample: sample_id names it, cartons_inspected is the sample size, and nonconforming_cartons counts cartons failing one or more checks. Count each carton only once.

1. Create the chart workspace

In the sidebar, open Process control, choose p Chart, and name the analysis. Select New blank worksheet and Create analysis.

2. Import the data

On Worksheet, choose Import. Select the downloaded file or paste its contents. Set the delimiter to Comma, use Decimal dot, and check First row contains column names. Preview the import, then choose Import into worksheet. Keep the rows in collection order.

3. Assign the input columns

On Inputs, assign sample_id to Subgroup label, nonconforming_cartons to Number of nonconforming units, and cartons_inspected to Subgroup size, selecting each from the column picker. Supply counts; the app calculates proportions from them.

Open Western Electric / AIAG rules. Leave all five optional rules On: 7-point trend, 6 on one side, 14 alternating, 2 of 3 beyond 2σ and 4 of 5 beyond 1σ.

p Chart: Inputs with the example’s assignments and settings
Sample labels, nonconforming-carton counts, inspected counts and enabled rules on Inputs. View full-size image (opens in a new tab)

4. Run analysis

Choose Run analysis, then open Results.

5. Interpret results

  1. Understand each point

    Each point is the proportion of cartons that fail inspection in one sample. For the first sample, 8 of 100 cartons fail: 8 / 100 = 0.08, or 8%. Count a carton once, even if it fails several checks. The chart center pools the counts: total nonconforming cartons divided by total cartons inspected, rather than an unweighted average of the sample percentages.

  2. Compare each point with its limits

    The overall nonconforming proportion is 6.014%. CTN33, CTN36, CTN37, CTN39 and CTN40 cross their upper limits. Sample sizes vary from 100 to 250 cartons, so the limits vary too. Smaller samples have wider limits.

    p control chart
    Nonconforming proportions for 40 carton samples. Each sample has its own limits. View full-size chart (opens in a new tab)
  3. Read the highlighted points

    A highlighted point can cross a limit or belong to a pattern inside the limits. Several rules may flag the same sample. Use the signal details to see which rule applies; do not count the rows as separate process problems.

  4. Decide what to investigate

    Check the inspection and process records for CTN33, CTN36, CTN37, CTN39 and CTN40. Confirm that cartons were classified consistently. The chart locates unusual proportions; it does not explain why the cartons failed.

More details: read each result section

Complete result tables use six significant digits, as in Help.

p chart summary

One carton is counted once as conforming or nonconforming. The center is total nonconforming cartons divided by total cartons inspected, not an unweighted average of the sample percentages.

p chart summary · 10 rows
Statistic / settingValue
Subgroups (k)40
Overall proportion (p̄)0.0601418
Minimum sample size100
Maximum sample size250
Beyond-limit detectionOn
7-point trendOn
6 on one sideOn
14 alternatingOn
2 of 3 beyond 2σOn
4 of 5 beyond 1σOn
  • Control limits and zones use each subgroup’s sample size or opportunities.

p values, control limits and zones

Each row lists inspected and nonconforming counts, their proportion and that sample’s limits. Use CTN labels to locate source rows. Compare proportions with their own limits because sample sizes vary.

p values, control limits and zones · 40 rows
SubgroupLabelNonconforming unitsSample sizepCLLCLUCL−1σ+1σ−2σ+2σSignals
1CTN0181000.080.060141800.1314670.03636690.08391680.0125920.107692None
2CTN02132500.0520.06014180.01503210.1052520.04510520.07517840.03006870.090215None
3CTN0372300.03043480.06014180.01311160.1071720.04446510.07581860.02878840.0914953None
4CTN04131900.06842110.06014180.008397370.1118860.04289370.077390.02564550.0946382None
5CTN0531100.02727270.060141800.1281470.03747330.08281040.01480480.105479None
6CTN06142100.06666670.06014180.0109230.1093610.04373560.07654810.02732930.0929544None
7CTN07142300.06086960.06014180.01311160.1071720.04446510.07581860.02878840.0914953None
8CTN08101800.05555560.06014180.006979450.1133040.0424210.07786260.02470020.0955834None
9CTN0931900.01578950.06014180.008397370.1118860.04289370.077390.02564550.0946382None
10CTN1031100.02727270.060141800.1281470.03747330.08281040.01480480.105479None
11CTN1192000.0450.06014180.009707570.1105760.04333040.07695330.0265190.0937647None
12CTN12182500.0720.06014180.01503210.1052520.04510520.07517840.03006870.090215None
13CTN13132500.0520.06014180.01503210.1052520.04510520.07517840.03006870.0902156 on one side
14CTN1491800.050.06014180.006979450.1133040.0424210.07786260.02470020.09558346 on one side, 6 on one side
15CTN1552500.020.06014180.01503210.1052520.04510520.07517840.03006870.0902156 on one side, 6 on one side, 6 on one side
16CTN1691800.050.06014180.006979450.1133040.0424210.07786260.02470020.09558346 on one side, 6 on one side, 6 on one side, 6 on one side
17CTN17112500.0440.06014180.01503210.1052520.04510520.07517840.03006870.0902156 on one side, 6 on one side, 6 on one side, 6 on one side, 6 on one side
18CTN1881800.04444440.06014180.006979450.1133040.0424210.07786260.02470020.09558346 on one side, 6 on one side, 6 on one side, 6 on one side, 6 on one side
19CTN19101800.05555560.06014180.006979450.1133040.0424210.07786260.02470020.09558346 on one side, 6 on one side, 6 on one side, 6 on one side
20CTN2061200.050.060141800.1252520.03843840.08184530.01673490.1035496 on one side, 6 on one side, 6 on one side
21CTN2192400.03750.06014180.01410190.1061820.04479520.07548850.02944850.09083526 on one side, 6 on one side
22CTN2261800.03333330.06014180.006979450.1133040.0424210.07786260.02470020.09558346 on one side
23CTN23101600.06250.06014180.003754610.1165290.04134610.07893760.02255040.0977333None
24CTN2441200.03333330.060141800.1252520.03843840.08184530.01673490.1035496 on one side
25CTN2561000.060.060141800.1314670.03636690.08391680.0125920.1076926 on one side
26CTN2671800.03888890.06014180.006979450.1133040.0424210.07786260.02470020.09558346 on one side
27CTN2751200.04166670.060141800.1252520.03843840.08184530.01673490.1035496 on one side
28CTN2861800.03333330.06014180.006979450.1133040.0424210.07786260.02470020.09558346 on one side
29CTN2951300.03846150.060141800.1226980.03928980.08099390.01843780.1018466 on one side
30CTN30142200.06363640.06014180.01205460.1082290.04411280.07617090.02808370.0922None
31CTN3141400.02857140.060141800.1204220.04004830.08023530.01995490.100329None
32CTN3271300.05384620.060141800.1226980.03928980.08099390.01843780.101846None
33CTN33201500.1333330.06014180.001905360.1183780.04072970.0795540.02131750.0989662Beyond 3σ, 6 on one side, 2 of 3 beyond 2σ, 4 of 5 beyond 1σ
34CTN3471000.070.060141800.1314670.03636690.08391680.0125920.1076926 on one side, 6 on one side
35CTN35212100.10.06014180.0109230.1093610.04373560.07654810.02732930.09295446 on one side, 6 on one side, 6 on one side, 2 of 3 beyond 2σ, 2 of 3 beyond 2σ, 2 of 3 beyond 2σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ
36CTN36191600.118750.06014180.003754610.1165290.04134610.07893760.02255040.0977333Beyond 3σ, 6 on one side, 6 on one side, 6 on one side, 2 of 3 beyond 2σ, 2 of 3 beyond 2σ, 2 of 3 beyond 2σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ
37CTN37191500.1266670.06014180.001905360.1183780.04072970.0795540.02131750.0989662Beyond 3σ, 6 on one side, 6 on one side, 6 on one side, 2 of 3 beyond 2σ, 2 of 3 beyond 2σ, 2 of 3 beyond 2σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ
38CTN38181800.10.06014180.006979450.1133040.0424210.07786260.02470020.09558346 on one side, 6 on one side, 6 on one side, 2 of 3 beyond 2σ, 2 of 3 beyond 2σ, 2 of 3 beyond 2σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ
39CTN39271700.1588240.06014180.005438190.1148450.04190730.07837640.02367270.0966109Beyond 3σ, 6 on one side, 6 on one side, 2 of 3 beyond 2σ, 2 of 3 beyond 2σ, 4 of 5 beyond 1σ, 4 of 5 beyond 1σ
40CTN40241900.1263160.06014180.008397370.1118860.04289370.077390.02564550.0946382Beyond 3σ, 6 on one side, 2 of 3 beyond 2σ, 4 of 5 beyond 1σ

Control chart signal details

Each row names an inspection index or label and a rule. Beyond limits identifies a crossing; other rules flag patterns that may stay inside the limits. Several rules may flag the same sample. These entries identify inspections to investigate, not the number of defective cartons.

Control chart signal details · 93 rows
Index (as returned)ChartRule
12p6 on one side
13p6 on one side
13p6 on one side
14p6 on one side
14p6 on one side
14p6 on one side
15p6 on one side
15p6 on one side
15p6 on one side
15p6 on one side
16p6 on one side
16p6 on one side
16p6 on one side
16p6 on one side
16p6 on one side
17p6 on one side
17p6 on one side
17p6 on one side
17p6 on one side
17p6 on one side
18p6 on one side
18p6 on one side
18p6 on one side
18p6 on one side
19p6 on one side
19p6 on one side
19p6 on one side
20p6 on one side
20p6 on one side
21p6 on one side
23p6 on one side
24p6 on one side
25p6 on one side
26p6 on one side
27p6 on one side
28p6 on one side
32p2 of 3 beyond 2σ
32p4 of 5 beyond 1σ
32p6 on one side
32pBeyond 3σ
33p6 on one side
33p6 on one side
34p2 of 3 beyond 2σ
34p2 of 3 beyond 2σ
34p2 of 3 beyond 2σ
34p4 of 5 beyond 1σ
34p4 of 5 beyond 1σ
34p4 of 5 beyond 1σ
34p6 on one side
34p6 on one side
34p6 on one side
35p2 of 3 beyond 2σ
35p2 of 3 beyond 2σ
35p2 of 3 beyond 2σ
35p4 of 5 beyond 1σ
35p4 of 5 beyond 1σ
35p4 of 5 beyond 1σ
35p4 of 5 beyond 1σ
35p6 on one side
35p6 on one side
35p6 on one side
35pBeyond 3σ
36p2 of 3 beyond 2σ
36p2 of 3 beyond 2σ
36p2 of 3 beyond 2σ
36p4 of 5 beyond 1σ
36p4 of 5 beyond 1σ
36p4 of 5 beyond 1σ
36p4 of 5 beyond 1σ
36p6 on one side
36p6 on one side
36p6 on one side
36pBeyond 3σ
37p2 of 3 beyond 2σ
37p2 of 3 beyond 2σ
37p2 of 3 beyond 2σ
37p4 of 5 beyond 1σ
37p4 of 5 beyond 1σ
37p4 of 5 beyond 1σ
37p6 on one side
37p6 on one side
37p6 on one side
38p2 of 3 beyond 2σ
38p2 of 3 beyond 2σ
38p4 of 5 beyond 1σ
38p4 of 5 beyond 1σ
38p6 on one side
38p6 on one side
38pBeyond 3σ
39p2 of 3 beyond 2σ
39p4 of 5 beyond 1σ
39p6 on one side
39pBeyond 3σ
  • Endpoint signal indices start at 0; chart subgroup numbers start at 1.

6. Create a report

Keep the p control chart, summary, sample values and limits, and signal details. Record the inspection basis and what you checked in CTN33, CTN36, CTN37, CTN39 and CTN40. Retain each sample’s size alongside its proportion.

Choose Add to report from the completed run. Open Choose individual items and advanced options to select tables and charts, then choose Add to draft. Hidden items stay in the saved analysis.

Name the report and add the purpose of the study and your interpretation. Choose Save, review Preview, then use Export → Download HTML. The example below contains the full selected content, including results beyond one screen.

Complete native output for this Help example, including applicable tables, charts and run notes. Report numbers use the app’s displayed precision. Exported charts are static. On narrow screens, scroll wide charts and tables sideways.
View example report: Monitor labeling failures when inspection sample sizes vary

We use Microsoft Clarity to understand how visitors use this website, including session recordings and heatmaps. You can use the website without accepting analytics.

Your choice is saved in this browser for six months. Privacy notice

Current choice: Not chosen.