Simulation HELP!

eliozo

Board Regular
Joined
Oct 22, 2010
Messages
80
Hello,
Thank you for helping me on the below:
I have to produce 6 items for example (item 1 to item 6). I have 3 lines of production (line 1,2,3) that can produce these 6 items. I have a table that shows me the time needed for every item to be produced on these lines. How can I do a simulation that gives me a result of which item with which other item should I produce on each line so that all 3 lines are equally functional with the same amount of time.
In the example below, ill explain better:
Thank you,
Time to produce in minutes
Item 1​
10
Item 2​
20
Item 3​
30
Item 4​
20
Item 5​
25
Item 6​
15
Simulation result: (what I want from Excel to give me)
Line 1​
Item 1 + Item 3
40 minutes​
Line 2​
Item 2 + Item 4
40 minutes​
Line 3​
Item 5 + Item 6
40 minutes​
 
12 items and 3 options works out to just over half a million, easily in range of a brute force approach. But if you can combine and/or split items, that changes everything. If you have a list of 25 items, we could just add up the total amount of minutes and divide by 3 to get the number of minutes per line. Then just assign items to line 1 until it meets or exceeds that number. If it exceeds that number, split that item into 2 sub-items, give part to line 1, part to line 2. Then assign everything to line 2 until you meet or exceed that number again, and split that item if needed, and assign the rest to line 3. I could probably do that with formulas.
Ok yes that could be an option if it wont work out with a macro. Will be waiting for your result then !! Thank you !!
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Give this a shot:

Book1
ABCDEFGHI
1ItemTimeLineTimeSplit to:TimeLineTime
2112112  1160
3242142  2160
4340140  3161
5422122  
6516116  Total time481
763412826Time per line160
8747247  
9847247  
10925225  
111019219  
12112021634
131255355  
141320320  
151437337  
161510310  
17163533431
18    
19    
Sheet3
Cell Formulas
RangeFormula
C2:C19C2=IF(A2="","",MATCH(SUM(D$2:D2),CHOOSE({1,2,3},0,$I$7+0.001,2*$I$7+0.001)))
D2:D19D2=IF(A2="","",MIN(B2,CEILING(SUM(B$1:B1)+0.001,$I$7)-SUM(B$1:B1)))
E2:E19E2=IF(D2<B2,MIN(C2+1,3),"")
F2:F19F2=IF(D2<B2,B2-D2,"")
I2:I4I2=SUMIF(C:C,H2,D:D)+SUMIF(E:E,H2,F:F)
I6I6=SUM(B2:B100)
I7I7=INT(I6/3)


Put the C2:F2 formulas in and drag down as far as needed. Then put in the H:I formulas. As you can see, the I7 formula shows how many minutes each line should get, with a possible difference of 1 or 2 minutes, which will go to line 3. Put in your items and times in columns A:B. Column C starts out at line 1, echoing the time from column B to column D, until the cumulative time exceeds the value in I7. When it does (row 7), it tells you to split item 6 into 2 parts, one part of 28 minutes that goes to line 1, and one part of 6 minutes that goes to line 2. The same thing happens on row 12. On row 17 it says to split item 17 in 2 parts, but both parts are in line 3. That's just the excess minute. You really don't need to split anything, it just made the formulas easier. Let me know how this works.
 
Upvote 0
=IF(A2="","",MATCH(SUM(D$2:D2),CHOOSE({1,2,3},0,$I$7+0.001,2*$I$7+0.001))
Hi Eric, I am working now on the file and see if it's gonna work. I am facing problems with this formula. When clicking enter it gives me there is an error and it seems where you wrote 1,2,3. Can you help please? thanks
 
Upvote 0
It worked now, i have to put ; between 1 2 and 3 in the choose function. Will give you update on the file. Thanks
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,986
Members
449,060
Latest member
mtsheetz

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