Keep the colours separate until after rounding
A combined yarn total cannot tell you how many balls of each shade to buy. This calculator treats A, B and C as separate supplies. You can name them after the actual shade codes, enter different ball weights and include usable stock. Spare A never silently pays for a shortage of B.
Required = base × (1 + allowance / 100)
Shortfall = max(0, required − usable stock)
New balls = round shortfall / ball weight UP
Allocate each component once
Measure the consumption of a representative finished motif in each relevant yarn. If C supplies all seams and the border, enter those component estimates in C's extra-grams field. The extra inputs are base estimates before this tool's margin. Do not enter an already-inflated component estimate unless you intentionally want another margin applied to it.
Stock means usable material of the right product, shade and acceptable batch. Exclude uncertain remnants or yarn already promised to another component. The model subtracts stock after calculating the requirement with its margin; it does not apply a percentage to your inventory.
Follow the supplied example
A has 15 motifs and B and C have 10 each, at 18 g per motif. C also needs 155.9 g for joins and border. With a 12% margin and no stock, the requirements are 302.4 g, 201.6 g and 376.208 g. Buying 100 g balls gives 4 A, 3 B and 4 C.
If you already have 120 g of A, its shortfall becomes 182.4 g and it needs two new 100 g balls. The unused amount shown is stock plus purchased grams minus the estimate. It is not a prediction of exactly what will remain after making the project.
Get the counts from a layout
The blanket planner provides a colour count for its three-colour arrangements and can transfer those counts here. You still supply the measured consumption: a count of squares is not a weight of yarn. Follow the 35-motif budget case to see how the seam and border inputs were established.
Totals are rounded for display only. Purchase decisions use the underlying values. When an estimate lies just above a whole-ball boundary, another ball may be required; inspect your measurements and chosen allowance before deciding to remove that margin.