Rotating Schedule based on Unit Volume Share

artikyulashun

New Member
Joined
Aug 21, 2012
Messages
41
[TABLE="class: outer_border, width: 1000, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD][/TD]
[TD]Week 1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Week 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]MFG A[/TD]
[TD]MFG B[/TD]
[TD]MFG C[/TD]
[TD][/TD]
[TD]MFG A[/TD]
[TD]MFG B[/TD]
[TD]MFG C[/TD]
[TD][/TD]
[TD]MFG A[/TD]
[TD]MFG B[/TD]
[TD]MFG C[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bananas[/TD]
[TD].6[/TD]
[TD].2[/TD]
[TD].2[/TD]
[TD][/TD]
[TD]ON[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD].1[/TD]
[TD].4[/TD]
[TD].5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]ON[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oranges[/TD]
[TD].3[/TD]
[TD].5[/TD]
[TD].2[/TD]
[TD][/TD]
[TD][/TD]
[TD]ON[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Columns A,B and C represent Percentage of Unit Volume by MFG for the Fruits to the left.

Using these numbers, I would like to generate a rotating 13-week promotional schedule for each item. Maximum number of weeks in a row that an MFG can have any one specific item on sale is two weeks. However, at the end of the of the 13-weeks, I'd like the number of instances that, for example, MFG A has Bananas on sale equal or near their share or .6.

My initial thought was you could use a ratio to create a patterned binary list of 1 and 0 or "on" and "off" for each item, but perhaps it is easier with these percentages? Perhaps this is simply a manual task.

Your feedback is appreciated.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Intriguing problem. Just to be sure I understand, every week every product will be on sale for one of the manufacturers? If so, I reorganized it a bit so each week has just 1 column, and instead of "ON", it shows the name of the manufacturer instead.

Given that, I started with this:

ABCDEFGHIJKLMNOPQR
MFG AMFG BMFG CWeek 1Week 2Week 3Week 4Week 5Week 6Week 7Week 8Week 9Week 10Week 11Week 12Week 13
BananasMFG AMFG CMFG AMFG CMFG CMFG AMFG AMFG AMFG CMFG AMFG CMFG CMFG A
ApplesMFG AMFG CMFG CMFG BMFG CMFG CMFG CMFG BMFG BMFG AMFG BMFG CMFG C
OrangesMFG CMFG BMFG BMFG BMFG AMFG BMFG AMFG BMFG BMFG BMFG CMFG CMFG B

<tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]0.6[/TD]
[TD="align: right"]0.2[/TD]
[TD="align: right"]0.2[/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]0.1[/TD]
[TD="align: right"]0.4[/TD]
[TD="align: right"]0.5[/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]0.3[/TD]
[TD="align: right"]0.5[/TD]
[TD="align: right"]0.2[/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F2[/TH]
[TD="align: left"]=INDEX($B$1:$D$1,MATCH(RAND(),SUBTOTAL(9,OFFSET($A2,0,0,1,{1,2,3}))))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]


Put the formula in F2, then drag it to the rest of the cells in the table.

The formula in F2 will randomly assign a manufacturer to each cell, based on the ratios in columns A:C. So each manufacturer should be listed roughly the right percentage, but it could vary some. The problem with this is that it does not take into account the maximum 2-week limit. That proved to be a tougher nut to crack. But I came up with this:

ABCDEFGHIJKLMNOPQR
MFG AMFG BMFG CWeek 1Week 2Week 3Week 4Week 5Week 6Week 7Week 8Week 9Week 10Week 11Week 12Week 13
BananasMFG AMFG AMFG BMFG AMFG CMFG AMFG BMFG AMFG AMFG BMFG BMFG AMFG A
ApplesMFG BMFG CMFG CMFG BMFG CMFG CMFG BMFG BMFG CMFG BMFG BMFG CMFG C
OrangesMFG AMFG BMFG BMFG AMFG CMFG BMFG AMFG CMFG BMFG BMFG AMFG BMFG A

<tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]0.6[/TD]
[TD="align: right"]0.2[/TD]
[TD="align: right"]0.2[/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]0.1[/TD]
[TD="align: right"]0.4[/TD]
[TD="align: right"]0.5[/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]0.3[/TD]
[TD="align: right"]0.5[/TD]
[TD="align: right"]0.2[/TD]
[TD="align: right"][/TD]

</tbody>
Sheet2

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]F2[/TH]
[TD="align: left"]{=INDEX($B$1:$D$1,LARGE(LOOKUP(ROW(INDIRECT("1:10"))-1,SUBTOTAL(9,OFFSET($A2,0,0,1,{1,2,3}))*10,{1,2,3}*SIGN(((D2<>E2)+(E2<>$B$1:$D$1)))),RANDBETWEEN(1,SUM(10*($B2:$D2*SIGN(((D2<>E2)+(E2<>$B$1:$D$1))))))))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]


Put the formula in F2, confirm with Control+Shift+Enter, then drag to the rest of the cells in the table. Also note that this works if your percentages are all 1 digit (.6). If you go to 2 digits, find the 10 in the formula (3 places) and replace it with 100.

This should prevent the same manufacturer more than 2 weeks in a row, and still keep the same ratios. If you want a different list, just press F9. This example shows no MFG A for apples, which is possible. Adding more constraints might push this into the realm of VBA though.

Let me know if this helps.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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