+ Reply to Thread
Results 1 to 4 of 4

Random numbers plus assigned number

Hybrid View

  1. #1
    Registered User
    Join Date
    09-16-2009
    Location
    Miramichi, Canada
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    3

    Random numbers plus assigned number

    Hi all,

    I have a group of 172 students. I want to be able to assign a student a teacher color and the vlookup will put that student into that teachers sheet. Which I did. However, if a student doesn't get an assigned color I want to randomly generate a number and have that student go into a teachers sheet.
    Sound confusing!
    For example:
    Any student that gets their cell highlighted green (colorcell=4), then they go into Mr. Wilson's class. Plus Mr. Wilson also takes any kid whose random number is between 1 and 20.
    I have attached the sheet so you can get a better idea.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Random numbers plus assigned number

    Hi

    without looking at your file, the following formula creates a random number between 1 and 20

    =ROUND(RAND()*19,0)+1

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Random numbers plus assigned number

    teylin, your use of ROUND biases the endpoints to have half the probability of the interior points. To generate a random number between 1 and 20 with uniform distribution,

    =int(rand()*20) + 1

    I don't think that solves the OP's problem though, but I don't understand well enough to make a suggestion.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Random numbers plus assigned number

    shg, had to think hard about that one:
    your use of ROUND biases the endpoints to have half the probability of the interior points
    but I've got it now. Thanks! Learnt something today.

+ 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