A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Random Number Generator - Help!



 
 
Thread Tools Display Modes
  #1  
Old November 3rd, 2003, 03:14 PM
external usenet poster
 
Posts: n/a
Default 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  
Old November 3rd, 2003, 03:22 PM
Peo Sjoblom
external usenet poster
 
Posts: n/a
Default 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  
Old November 3rd, 2003, 03:33 PM
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.