
Sample size: how many positions are enough to count
Sample size depends on the accuracy and confidence you want; counting everything is not always necessary.
A full count of a warehouse with 8 000 positions takes several days, sometimes a week, and halts operations. Sometimes, though, the question is different: "Roughly how accurate are our records?" To answer it you do not have to count everything; a properly chosen sample is enough. There is only one question: how many positions are enough?
What determines the size
Three things.
- The confidence level. Usually 95 percent, which corresponds to z = 1.96 (1.645 for 90 percent, 2.576 for 99 percent).
- The margin of error e: how precise the result must be, for example ± 3 points.
- The expected accuracy p: the share from a previous count. If you do not know it, take the most cautious value p = 0.5, which gives the largest sample.
The formula and an example
Initial sample n₀ = z² × p × (1 − p) ÷ e². When the number of positions N is finite, a correction applies: n = n₀ ÷ (1 + (n₀ − 1) ÷ N), where n₀ is the result of the formula above.
Example: N = 8 000 positions. At the previous count accuracy was 90 percent (p = 0.9). You want 95 percent confidence and ± 3 points.
n₀ = 1.96² × 0.9 × 0.1 ÷ 0.03² = 3.8416 × 0.09 ÷ 0.0009 ≈ 384.2. With the correction: 384.2 ÷ (1 + 383.2 ÷ 8 000) ≈ 366.6, that is 367 positions.
In Excel put n₀ in cell B1: PRODUCT(1.96^2, 0.9, 0.1) / 0.03^2. Keep N = 8 000 in B2. The corrected result is ROUNDUP(B1 / (1 + (B1 - 1) / B2), 0). The separator (comma or semicolon) depends on your Excel settings.
Under other conditions (N = 8 000, 95 percent confidence):
- p = 0.9, ± 5 points: 136 positions.
- p unknown (0.5), ± 3 points: 942 positions.
- p = 0.97, ± 2 points: 271 positions.
Raise the confidence to 99 percent (± 3, p = 0.9) and you need 613 positions. Demands for precision and confidence inflate the sample quickly, whereas the size of the warehouse hardly matters.
Reading the result
Say 400 positions were counted and 352 matched the records: 352 ÷ 400 = 88 percent. The margin of error is 1.96 × √(0.88 × 0.12 ÷ 400) ≈ 0.032, that is ± 3.2 points. So accuracy across the whole warehouse is roughly 84.8 to 91.2 percent. Out of 8 000 positions that means about 6 800 to 7 300 matching ones.
A small sample gives a wide range: with p = 0.9, 30 positions give an error of ± 10.7 points and 100 positions ± 5.9. That is why "we counted ten and all is fine" is not a justified conclusion.
If the result falls short of the target (say you needed 95 percent and got 88), the decision is usually one of two: count the whole warehouse, or find the zone where errors accumulate. The second is cheaper, so break the sample's discrepancies down by zone and category.
How to choose
The formula holds only for random selection. Export all positions from 1C to Excel, enter RAND() in a new column, sort by it and take the first 400. Or take every 20th item on the list (8 000 ÷ 400 = 20), picking the starting point at random.
A sample taken from convenient shelves or "familiar" goods gives a false picture. Fix the sample before counting and do not swap an awkward position for another.
If expensive goods need more attention, sample by layers: count group A in full and B and C by sample. Suppose group A (400 positions) has 95 percent accuracy and a sample from the other 7 600 gives 87 percent; overall accuracy is then (400 × 0.95 + 7 600 × 0.87) ÷ 8 000 ≈ 87.4 percent.
Limitations
- A sample estimates the share but does not find the shortage. The differences found are corrected; the positions not counted remain as they are.
- Choosing whole racks or zones increases the error, because neighbouring positions tend to go wrong in similar ways.
- If your accountant or auditor requires it, a full stock count may be compulsory.
Conclusion
Sample size depends on three decisions: the confidence, the margin of error and the expected accuracy. A well-chosen 300-400 positions often reveal the state of a large warehouse. CountLab combines sample-based and full stock counts and presents the results together with ABC/XYZ analysis and a management report.