# Random Number Generation

#### jlstorlie

##### New Member
I have a question. I am trying to randomly assign operators to job functions. I have a list of their names in one column, in the second I have randomly assigned job functions 1 - 8. The problem is somedays I only need four operators in job function 6, three in job function 4, etc. Currenlty I just get a random amount of each integer regardless of the demand of each job function. Is there a way to assign the numbers to be random, but have a set count of each number (four 6s, three 4s, etc.)? Please advise.

Thanks!!

### Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

#### Richard Schollar

##### MrExcel MVP
How do you determine how many employees are required for each task each day? Or is this provided to you?

Best regards

Richard

#### jlstorlie

##### New Member
The number of employees is determined by volume of work we have each day, which varies by customer demand. If we have to produce 4,500 of Product A we need x many employees in function 2, y employees in function 5 and so on.

#### Greg Truby

##### MrExcel MVP
I took a look at your problem. But I think that what you need is a random sample without replacement. The solution below is based on random with replacement and therefore can result in the same person getting assigned the same task in the same day -- which probably is not ok. You might do a search here and see if you can pull up a thread on random sampling without replacement. Or maybe another member can think of a quick way to do it. But, if not for the replacement issue, is this what you're trying to describe?
sampling with replacement problem (scheduling).xls
ABCDEFGH
1AmyAmy,Bob,Fred,Cathy,Dan
2 Amy,Gina,Cathy,Dan
3 HalFred,Emily,
4  FredGina,
5   Amy
6
7
8
10BobDemand134521
11CathyAmy
12DanAmy,Amy,Hal
13EmilyBob,Gina,Fred,Fred
14FredFred,Cathy,Emily,Gina,Amy
15GinaCathy,Dan
16HalDan
Sheet1

Replies
41
Views
1K
Replies
6
Views
189
Replies
2
Views
271
Replies
2
Views
223
Replies
4
Views
186

1,195,618
Messages
6,010,730
Members
441,566
Latest member
spimcom

### 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.

### Which adblocker are you using?

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

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