PDA

View Full Version : two number combos in excel

stevew
2011-10-24, 04:20 AM
i have two number lengths. 2560mm and 3405mm. I need to know how to get best combination for a given length..say 8500mm. so answer will give answer of 2 x 3405 and 1 x 2560mm. Answer must be equal or longer than set target length.

Simon Lloyd
2011-10-24, 07:19 AM
How will you set your constraints? my best answer for 8500mm would be 1x7499 & 1x1....see what i mean?, there are around 35,000,000+ possible combinations of giving 1+1 of something let alone 2+1 or 2+3+1...etc!!!!!!

stevew
2011-10-24, 07:28 AM
Im not sure. the combination would be the smallest number over the set target length though.

Simon Lloyd
2011-10-24, 08:22 AM
Ok, just to throw a spanner in the works then the smallest numeber of pieces over the target length will always be 1 , it will never be 2 or 3, therefore, your example would be 1 x 8500mm (smallest possible) after that you start having to choose from many millions of combinations.

I feel you're missing my point, you need to draw up a table of sizes for whatever it is your working with, same sizes across the top as down the side (like a mileage chart) so you can always intersect for two pieces so your first column would be 1 down to 8500 your first row would be the same. Now your thinking that you need to have more pieces, so how long is a piece? where does it not fit in with the equation before you need another piece?

It's a lot more complicated that you think, but until you can come up with some parameters on when another piece should be selected and repeated until the size requirement is complete we'll be unable to help.

stevew
2011-10-24, 08:46 AM
I will always only have two sizes: 3405 and 2560.

If target length is 6500, then I know that two 3405 lengths is the answer as it totals 6810, which is the smallest combination that is ≥
number over target length of 6500.

A target of 5000 would give result of two 2560 lengths (2560+2560=5120)
A target of 8500 would give result of one 3405 and two 2560 lengths (3405+2560+2560=8525)