Denominations with least waste.

Winehouse

New Member
Joined
Jul 29, 2018
Messages
33
Hi.

I'm using Numbers on Mac.

I'd like to work out on Numbers, how many different stamp denominations I'll need for a large cost, with the least amount of wastage.

For instance, if a package costs £9.99 to send, and I have 0.85p & 0.66p stamps, the best way is 4x 0.85p & 10x 0.66p. This leaves waste of 1p.

Thank you for your help.

Regards

Winehouse
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Interesting question. There are a few options. You could use the Solver to figure that out. There is also an esoteric branch of mathematics called Diophantine Equations that might work. (If I have some time, I might play around with it and see if there's an easy solution for that.) But the fastest way I could figure this out would just to try all possibilities and choose the best. Here's one example:

Book1 (version 1).xlsb
ABCDEF
1CostStamp1 priceStamp2 price
29.990.850.66
3
4# of Stamp1# of stamp2WastageRemainder after stamp1
50160.579.99
61140.109.14
72130.298.29
83120.487.44
94100.016.59
10590.205.74
11680.394.89
12770.584.04
13850.113.19
14940.302.34
151030.491.49
161110.020.64
1712-1-0.45-0.21
Sheet24
Cell Formulas
RangeFormula
B5:B17B5=SEQUENCE(ROUNDUP(A2/C2,0)+1,,0)
C5:C17C5=ROUNDUP(F5#/D2,0)
D5:D17D5=C5#*D2-F5#
F5:F17F5=A2-C2*B5#
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B5:D17Expression=$D5=AGGREGATE(15,6,$D$5#/($D$5#>=0),1)textNO


You did not state what version of Excel you have, so I just assumed the latest one. If you don't have SEQUENCE, I can rewrite these. I might try to rewrite these so that you don't have to see every line, or need the column F helper column. But there might actually be some value in seeing every row. For example, as you said 4 of stamp1 and 10 of stamp2 results in a wastage of .01. But say you don't have 10 of stamp2 available. Then you would see that you can use 11 of stamp1 and only 1 of stamp2, and still only have a wastage of .02.
 
Upvote 0
It does not sound they are using Excel at all. The first line of their question says:

Hmm. I missed that. Well, I hope that the formulas can be converted easily to whatever Numbers uses. Incidentally, the C5 formula should be

Excel Formula:
=CEILING(F5#/D2,1)

to avoid the -1 value.
 
Upvote 0

Forum statistics

Threads
1,223,975
Messages
6,175,749
Members
452,667
Latest member
vanessavalentino83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top