If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Random Number Generator - Help!
Any and all help is appreciated.
Starting in Cell B7, I have a list of names. In E7 is a sequential number (starting at 1) that is associated with each name. The list has the potential to be up to 250 names. Other cells (in column A, C & D) have additional data associated with each name. A macro enters the data and increments the number by 1 each time. I want to select a name at random. In Cell H19 I have the following formula: =RAND()*MAX(E7:E256))+1 In Cell H20 I have a lookup formula to display a name: =VLOOKUP(H19, A7:E256,2,TRUE) This works pretty well, except when a random number is generated (with digital fractions) sometimes the same name is selected. Example: 5.19 would select Name6 and 5.65 would also select Name6. I hope to select a different name each time a random number is generated. Any thoughts? Thanks Mike |
#2
|
|||
|
|||
Random Number Generator - Help!
You can use this in H9
=INT(RAND()*(250-1)+1) it will generate a numbers between 1 and 250, of course since it is random it can come up more than once.. -- Regards, Peo Sjoblom wrote in message ... Any and all help is appreciated. Starting in Cell B7, I have a list of names. In E7 is a sequential number (starting at 1) that is associated with each name. The list has the potential to be up to 250 names. Other cells (in column A, C & D) have additional data associated with each name. A macro enters the data and increments the number by 1 each time. I want to select a name at random. In Cell H19 I have the following formula: =RAND()*MAX(E7:E256))+1 In Cell H20 I have a lookup formula to display a name: =VLOOKUP(H19, A7:E256,2,TRUE) This works pretty well, except when a random number is generated (with digital fractions) sometimes the same name is selected. Example: 5.19 would select Name6 and 5.65 would also select Name6. I hope to select a different name each time a random number is generated. Any thoughts? Thanks Mike |
#3
|
|||
|
|||
Random Number Generator - Help!
Thanks Peo. That works much better.
Mike -----Original Message----- You can use this in H9 =INT(RAND()*(250-1)+1) it will generate a numbers between 1 and 250, of course since it is random it can come up more than once.. -- Regards, Peo Sjoblom wrote in message ... Any and all help is appreciated. Starting in Cell B7, I have a list of names. In E7 is a sequential number (starting at 1) that is associated with each name. The list has the potential to be up to 250 names. Other cells (in column A, C & D) have additional data associated with each name. A macro enters the data and increments the number by 1 each time. I want to select a name at random. In Cell H19 I have the following formula: =RAND()*MAX(E7:E256))+1 In Cell H20 I have a lookup formula to display a name: =VLOOKUP(H19, A7:E256,2,TRUE) This works pretty well, except when a random number is generated (with digital fractions) sometimes the same name is selected. Example: 5.19 would select Name6 and 5.65 would also select Name6. I hope to select a different name each time a random number is generated. Any thoughts? Thanks Mike . |
Thread Tools | |
Display Modes | |
|
|