Business & tax

Cash denomination allocation with limited stock calculator

Find a minimum-piece exact cash allocation from custom denominations and limited available notes or coins, including cases where a greedy choice fails.

Your numbers

One record per line. Commas separate cells; no thousands separators or quoted CSV. Dates use YYYY-MM-DD.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Try it, understand it

Explore the result

Find a minimum-piece exact cash allocation from custom denominations and limited available notes or coins, including cases where a greedy choice fails.

Worked example comparison
ExampleOutputWhat to notice
Worked exampleExact amount possibleYesFor an exact 1,370 amount, the example stock can supply two 500s, one 200, one 100, one 50 and one 20: six pieces in total.
Compare a different assumptionExact amount possibleYesCompare the detailed table as well as the headline result. The changed assumption is explicit; other worked-example inputs stay fixed.

Check your understanding

What does the worked example demonstrate?

For an exact 1,370 amount, the example stock can supply two 500s, one 200, one 100, one 50 and one 20: six pieces in total.

What is the important limit of this calculation?

Integer amount up to 100,000 and at most 30 distinct denomination rows, subject to a seven-million-step browser budget. No automatic currency validation, payment rounding or banknote authenticity check.

Behind the numbers

How this calculation works

An unlimited-denomination change calculation is not enough when a till has only a few notes of a particular value. Each denomination here has its own maximum available count. The selected allocation must obey those counts and match the requested amount exactly.

THE FORMULABounded dynamic programming minimizes piece count subject to exact value and entered denomination stock

A worked example

For an exact 1,370 amount, the example stock can supply two 500s, one 200, one 100, one 50 and one 20: six pieces in total.

Good to know

Integer amount up to 100,000 and at most 30 distinct denomination rows, subject to a seven-million-step browser budget. No automatic currency validation, payment rounding or banknote authenticity check.

Available stock changes the problem

An unlimited-denomination change calculation is not enough when a till has only a few notes of a particular value. Each denomination here has its own maximum available count. The selected allocation must obey those counts and match the requested amount exactly.

The algorithm minimizes total pieces across the permitted combinations. It does not assume that taking the largest available denomination first always works. For example, an amount of six with one four and two threes is solved by the two threes, while a greedy first choice of four can get stuck.

A greatest common divisor check can identify some impossible amounts when every denomination shares a factor. Divisibility is necessary but does not establish that the available stock can form the requested amount.

Choose a consistent integer unit

Enter all values as whole units. For currency with fractional coins, use the smallest relevant unit consistently for the amount and every denomination. An amount of 1.25 could therefore be entered as 125 minor units rather than a decimal.

A result of no exact allocation does not mean payment should be rounded or a customer should receive a different amount. It means only that the entered stock cannot form that value under these constraints.

Equal optima need not look identical

Different denomination combinations can have the same minimum piece count. The calculator may return either such optimum; it does not rank banknote preferences, future till needs or denomination wear. Inspect the allocation table rather than relying only on the piece count.

The browser work limit bounds the dynamic-programming problem. A very large amount combined with many effective stock choices can be rejected. Reducing units is valid only when every denomination and the owed amount can be scaled exactly without losing value.

Work through the example

For an exact 1,370 amount, the example stock can supply two 500s, one 200, one 100, one 50 and one 20: six pieces in total.

Use the worked table to trace where each input enters. Then change one assumption and calculate again, leaving the others fixed. A comparison is easier to interpret when the change has one identifiable cause rather than a different set of measurements, dates and rates all at once.

What this model does not establish

Integer amount up to 100,000 and at most 30 distinct denomination rows, subject to a seven-million-step browser budget. No automatic currency validation, payment rounding or banknote authenticity check.

Keep the input assumptions with any exported result. Illustrative values do not become observations merely because the output is precise. For a real purchase, financial reconciliation or technical decision, check the underlying records and applicable requirements before treating this scenario as a final answer.

A few questions, answered

What formula does the calculator use?

Bounded dynamic programming minimizes piece count subject to exact value and entered denomination stock

What should I verify before using this result?

Integer amount up to 100,000 and at most 30 distinct denomination rows, subject to a seven-million-step browser budget. No automatic currency validation, payment rounding or banknote authenticity check.

Are the example inputs live records?

No. They are an illustrative calculation case. Replace them with records and measurements appropriate to your situation.

Find your calculator

Start typing to explore the library.