+ Reply to Thread
Results 1 to 9 of 9

Random Item

  1. #1
    Registered User
    Join Date
    07-08-2005
    Posts
    9

    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?

  2. #2
    Max
    Guest

    Re: 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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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. #3
    Max
    Guest

    Re: 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. #4
    Registered User
    Join Date
    07-08-2005
    Posts
    9
    sorry to be a pain, but how does one define a range?

  5. #5
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




  6. #6
    Registered User
    Join Date
    07-08-2005
    Posts
    9

    Well

    I defined the group, and tried this

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

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

  7. #7
    Registered User
    Join Date
    07-08-2005
    Posts
    9
    Nevermind - issue resolved

    Muchas gracias

  8. #8
    Gary''s Student
    Guest

    RE: 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. #9
    Max
    Guest

    Re: Random Item

    Glad to hear that !
    --
    Max
    Singapore
    http://savefile.com/projects/236895
    xdemechanik
    ---
    "capnsean" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Nevermind - issue resolved
    >
    > Muchas gracias




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1