Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
hbb2699
 
Posts: n/a
Default Creating a formula using RAND


I have a spreadsheet that has a group of peoples names on it. I want to
be able to create a formula that will cause it to randomly choose one
of those people on the list. I know there is a way to create a formula
for this but I completely clueless on how I would type the formula in.
Can anyone help me with this? Thank you!


--
hbb2699
------------------------------------------------------------------------
hbb2699's Profile: http://www.excelforum.com/member.php...o&userid=35224
View this thread: http://www.excelforum.com/showthread...hreadid=552313

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Creating a formula using RAND

=INDEX(A1:A10,INT(RAND()*10)+1)

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"hbb2699" wrote in
message ...

I have a spreadsheet that has a group of peoples names on it. I want to
be able to create a formula that will cause it to randomly choose one
of those people on the list. I know there is a way to create a formula
for this but I completely clueless on how I would type the formula in.
Can anyone help me with this? Thank you!


--
hbb2699
------------------------------------------------------------------------
hbb2699's Profile:

http://www.excelforum.com/member.php...o&userid=35224
View this thread: http://www.excelforum.com/showthread...hreadid=552313



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Creating a formula using RAND

hbb2699 wrote:
I have a spreadsheet that has a group of peoples names on it. I want to
be able to create a formula that will cause it to randomly choose one
of those people on the list. I know there is a way to create a formula
for this but I completely clueless on how I would type the formula in.


There are many ways to do this. To introduce the concept, the
following might suffice:

=index(A1:A10, int(10*rand()) + 1)

where A1:A10 contains the list of people. The key is that
int(10*rand()) returns a number between 0 and 9.

You will quickly learn the downside of relying on RAND() per se: it is
recalculated every time any cell in the spreadsheed is modified. I
work around that by creating a UDF, myrand(), which simply returns
Rnd(). That is not a perfect solution, but it eliminates 99% of the
recalculations.

Caveat: The above solution does not avoid duplicate results if you use
the formula in multiple cells. If you want unique results (i.e. random
selection without replacement), it can be done.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Count formula Shelyna Excel Worksheet Functions 1 May 30th 06 10:13 PM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Creating charts from formula results Boba Fett Excel Discussion (Misc queries) 1 August 22nd 05 07:04 PM
need help creating formula based on cell value Brad Excel Discussion (Misc queries) 3 April 1st 05 07:51 PM
Creating a specific formula booroni New Users to Excel 3 March 26th 05 10:05 AM


All times are GMT +1. The time now is 09:48 AM.

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

About Us

"It's about Microsoft Excel"