Random Number Generator

Tomson74

New Member
Joined
Aug 11, 2015
Messages
2
Hey guys,

Let me first say "thank you" in advanced. I was asked to create a random number generator. I am using the =CHOOSE(RANDBETWEEN(x,x) function.
So for example, My formula looks like this =CHOOSE(RANDBETWEEN(1,4382),1,24,57,65,66,72,79,107,149,173,174,214,219,400,645,650,658,846,872,1040,1131,1138,1321,1441,1442,1745,1747,2089,2132,2266,2277,2341,2344,2409,2473,2693,2780,2905,2907,2979,3031,3081,3094,3125,3142,3277,3281,3291,3303,3313,3361,3390,3465,3472,3482,3535,3536,3579,3623,3640,3746,3772,3779,3781,3796,3823,3850,3964,4060,4074,4081,4089,4091,4093,4103,4122,4140,4154,4207,4217,4252,4277,4278,4281,4282,4283,4382)

I have to leave some numbers out because these are employee ID's. So there is no employee assigned to let's say 2 or 3 etc. I keep getting formula is volatile. When running this.
What am I missing here?

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hey guys,

Let me first say "thank you" in advanced. I was asked to create a random number generator. I am using the =CHOOSE(RANDBETWEEN(x,x) function.
So for example, My formula looks like this =CHOOSE(RANDBETWEEN(1,4382),1,24,57,65,66,72,79,107,149,173,174,214,219,400,645,650,658,846,872,1040,1131,1138,1321,1441,1442,1745,1747,2089,2132,2266,2277,2341,2344,2409,2473,2693,2780,2905,2907,2979,3031,3081,3094,3125,3142,3277,3281,3291,3303,3313,3361,3390,3465,3472,3482,3535,3536,3579,3623,3640,3746,3772,3779,3781,3796,3823,3850,3964,4060,4074,4081,4089,4091,4093,4103,4122,4140,4154,4207,4217,4252,4277,4278,4281,4282,4283,4382)

I have to leave some numbers out because these are employee ID's. So there is no employee assigned to let's say 2 or 3 etc. I keep getting formula is volatile. When running this.
What am I missing here?
You do not want RANDBETWEEN to generate the employee ID randomly, you want it to generate the index to the employee ID in the argument list for the CHOOSE function randomly. If I counted correctly, there are 87 employee IDs in your list, so you need to change the red highlighted number above to 87 and then, if I counted correctly, the formula should work correctly.
 
Upvote 0
You do not want RANDBETWEEN to generate the employee ID randomly, you want it to generate the index to the employee ID in the argument list for the CHOOSE function randomly. If I counted correctly, there are 87 employee IDs in your list, so you need to change the red highlighted number above to 87 and then, if I counted correctly, the formula should work correctly.



That was it. It worked!!!

Thank you very much!
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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