Allocation across Cells

jlkirk

Active Member
Joined
May 6, 2002
Messages
328
Office Version
  1. 365
In Column A1:A25 I have a list of varying quantities of unique products ranging from 1 to 250 units. In Column B1:B25 I have listed the corresponding costs of each product, which may be duplicated. I receive various orders for mixes of my products. What I would like to do is allocate each order across my list of products to minimize my costs per order.

For example, if I get an order for 25 units of mixed product, and I have 10 units of Product No 1 at $1.50, 20 units of No 2 at $1,75, and 40 units of No 3 at $5.00, the order mix would be made up of 10 units of No 1,and 15 units of No 2. Alternatively, if the order was 35 units, it would be made up of all of No 1, all of No 2 and 5 of No 3.

Any ideas?

Thanks in advance.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
If you are willing to sort your product table (use Sort & Filter on the Data tab, then choose Filter, and select the drop down in the column heading for UnitPrice and sort smallest to largest), then add an Order Allocation column and paste the formula shown and copy down.

mrexcel_20200408.xlsx
ABCDEFG
1QtyUnitPriceProduct NameOrder Allocation300<--Order size
2380.46Product 238
3580.46Product 458
4290.68Product 729
51341.72Product 8134
6272.92Product 2327
7253.2Product 2414
81483.37Product 20 
91733.81Product 3 
10714.38Product 6 
11274.54Product 13 
121344.55Product 21 
131824.86Product 22 
1465.3Product 14 
15115.41Product 18 
16475.61Product 1 
171916.26Product 19 
18446.64Product 10 
19866.7Product 9 
201416.76Product 25 
21727.98Product 12 
221288.97Product 5 
23629.12Product 17 
24569.19Product 16 
2549.21Product 11 
261349.23Product 15 
Sheet9
Cell Formulas
RangeFormula
D2:D26D2=IF(SUM(D$1:D1)<$F$1,MIN(A2,$F$1-SUM(D$1:D1)),"")
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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