Build packages based on remaining product

Sleepingsouls

New Member
Joined
Jan 22, 2018
Messages
20
Hi I'm building out a spreadsheet that will help me sell my products better - Sometimes I have leftover and/or too many of a few types so I build them into packages.
I currently have a spread sheet (see below for rough idea) that is dynamic and I can change the products I offer in different packages - at the moment the packages are manual as in, I have to say how much of each product I would like in the package, and it gives me an adjusted amount so that I don't go below 0. What I'm trying to do now is build a way for it to auto fill the packages for me based on the product I have remaining.

So if I say product A has 5 quantity and I put 2 in Package 1, 2 in package 2 and 1 in package 3 the adjusted quantity will show 0. But is there a way to tell excel if quantity of A >0 sort amount between Package 1,2,3?

ProductWeightQauntityAdjusted QuantityPackage 1
AProductWeightQuantity
BA
CB
DC
E
F
GPackage 2
A
D
F
Package 3
F
G
C
E
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
i'd suggest something like this (all in 1 line to make formulas simple)
The green cells, you can use.
C:F = the qty's are now assigning
I:K = the remaining excel is assigning, using the proportions of C:F
N:P = correction, that can be to assign the remainings in L, or the value can even be negative, if excel gave too much in the columns I:K
The yellow cells are the results

Map1
ABCDEFGHIJKLMNOPQRSTU
1manuallyautomanuallytotal
2ProductWeightQuantitypackage1package2package3assigned 1remaining 2Extra1Extra2Extra3assigned 2remaining 3Extra1Extra2Extra3assigned 2still remainingpackage1package2package3
3A11221562215101442
4B1151650404101091
5C11222651113202333
6D1111101000100-95400254
7E1123562305101460
8F11221562215101442
9G11221562215101442
Blad5
Cell Formulas
RangeFormula
G3:G9,L3:L9,Q3:Q9G3=SUM(D3:F3)
H3:H9,M3:M9H3=+C3-G3
I3:K9I3=IF($H3>0,FLOOR($H3*D3/$G3,1),0)
R3:R9R3=M3-SUM(N3:Q3)
S3:U9S3=+D3+I3+N3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
R3:R10Expression=R3<0textNO
A2:U3,A4:Q9,S4:U9,R4:R10Expression=A2=0textNO
M3:M9Expression=M3<0textNO
H3:H9Expression=H3<0textNO
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

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