#1   Report Post  
Posted to microsoft.public.excel.misc
capnsean
 
Posts: n/a
Default Random Item


I -have- searched for a previous post regarding this problem, but came
up with nothing all that useful.

Problem: I need to generate a random item from a list.

I.E.: A1 = alpha
A2 = beta
A3 = gamma
etc.

B1 = RANDOM choice of alpha, beta, or gamma


Any help?


--
capnsean
------------------------------------------------------------------------
capnsean's Profile: http://www.excelforum.com/member.php...o&userid=25049
View this thread: http://www.excelforum.com/showthread...hreadid=508974

  #2   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Random Item

Another option, placed in any cell:
=INDEX({"alpha";"beta";"gamma"},randbetween(1,3))

(adjust the "3" to be equal to the number of items)

Press F9 to regenerate

Note that Randbetween requires the Analysis Toolpak be installed and enabled
(via Tools Add-Ins)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"capnsean" wrote in
message ...

I -have- searched for a previous post regarding this problem, but came
up with nothing all that useful.

Problem: I need to generate a random item from a list.

I.E.: A1 = alpha
A2 = beta
A3 = gamma
etc.

B1 = RANDOM choice of alpha, beta, or gamma


Any help?


--
capnsean
------------------------------------------------------------------------
capnsean's Profile:

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



  #3   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Random Item

If the items are listed within a defined range named "Items",
an alternative to use (in any cell) would be:
=INDEX(Items,randbetween(1,COUNTA(Items)))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #4   Report Post  
Posted to microsoft.public.excel.misc
Tom Ogilvy
 
Posts: n/a
Default Random Item

RANDBETWEEN requires the analysis tookpak be installed. You can just use
the built in rand


= OFFSET(A1,Trunc(RAND()*3),0)

=Index(A1:A3,Trunc(rand()*CountA(A1:A3)+1),1)


--
Regards,
Tom Ogilvy


"capnsean" wrote in
message ...

I -have- searched for a previous post regarding this problem, but came
up with nothing all that useful.

Problem: I need to generate a random item from a list.

I.E.: A1 = alpha
A2 = beta
A3 = gamma
etc.

B1 = RANDOM choice of alpha, beta, or gamma


Any help?


--
capnsean
------------------------------------------------------------------------
capnsean's Profile:

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



  #5   Report Post  
Posted to microsoft.public.excel.misc
capnsean
 
Posts: n/a
Default Random Item


sorry to be a pain, but how does one define a range?


--
capnsean
------------------------------------------------------------------------
capnsean's Profile: http://www.excelforum.com/member.php...o&userid=25049
View this thread: http://www.excelforum.com/showthread...hreadid=508974



  #6   Report Post  
Posted to microsoft.public.excel.misc
capnsean
 
Posts: n/a
Default Random Item


I defined the group, and tried this

=INDEX(Items,randbetween(1,COUNTA(Items)))

function, to no avail...
I'm getting the ol' #Name?


--
capnsean
------------------------------------------------------------------------
capnsean's Profile: http://www.excelforum.com/member.php...o&userid=25049
View this thread: http://www.excelforum.com/showthread...hreadid=508974

  #7   Report Post  
Posted to microsoft.public.excel.misc
capnsean
 
Posts: n/a
Default Random Item


Nevermind - issue resolved

Muchas gracias


--
capnsean
------------------------------------------------------------------------
capnsean's Profile: http://www.excelforum.com/member.php...o&userid=25049
View this thread: http://www.excelforum.com/showthread...hreadid=508974

  #8   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Random Item

In B1 enter =RAND() and copy down to B3.

Then sort columns A&B by B; this will "shuffle" the order of the items in A.

Pick the first item in column A
--
Gary''s Student


"capnsean" wrote:


I -have- searched for a previous post regarding this problem, but came
up with nothing all that useful.

Problem: I need to generate a random item from a list.

I.E.: A1 = alpha
A2 = beta
A3 = gamma
etc.

B1 = RANDOM choice of alpha, beta, or gamma


Any help?


--
capnsean
------------------------------------------------------------------------
capnsean's Profile: http://www.excelforum.com/member.php...o&userid=25049
View this thread: http://www.excelforum.com/showthread...hreadid=508974


  #9   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Random Item

Glad to hear that !
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"capnsean" wrote in
message ...

Nevermind - issue resolved

Muchas gracias



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
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
sort bar chart in excel BuriedInSpreadSheets Charts and Charting in Excel 6 May 31st 07 04:12 PM
Random Item capnsean Excel Discussion (Misc queries) 3 February 7th 06 02:04 AM
VBA "Rnd" Function: Truly Random? TheRobsterUK Excel Discussion (Misc queries) 2 September 27th 05 04:50 AM
Linking Several Worksheets to One Worksheet TangentMemory Excel Discussion (Misc queries) 1 May 10th 05 11:37 PM


All times are GMT +1. The time now is 08:42 AM.

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

About Us

"It's about Microsoft Excel"