+ Reply to Thread
Results 1 to 3 of 3

How to generate #'s that excludes certain numbers?

Hybrid View

  1. #1
    dojistar
    Guest

    How to generate #'s that excludes certain numbers?

    Hi, I'd like to generate 4 different numbers from 1 to 50 but EXCLUDING
    numbers 3 and 24. Your help is greatly appreciated!

  2. #2
    vezerid
    Guest

    Re: How to generate #'s that excludes certain numbers?

    There are several ways. One way is to use two columns: In column K:K
    (say starting from K2) you enter all the admissible numbers. Then, one
    column before, type 0 in J2 and then in J3 type =J2+1/48 and copy all
    the way to J49.

    Then, to generate random numbers use:
    =VLOOKUP(RAND(), $J$2:$K$49,2)
    This will produce your numbers with equal probability.

    Another, not so precise formula:
    =IF(RAND()<2/48, 1+INT(RAND()*2), IF(RAND()<20/48, 4+INT(RAND()*20),
    25+INT(RAND()*26)))

    HTH
    Kostis Vezerides


  3. #3
    Max
    Guest

    Re: How to generate #'s that excludes certain numbers?

    "dojistar" wrote
    > .. I'd like to generate 4 different numbers from 1 to 50
    > but EXCLUDING numbers 3 and 24.


    Another play to try ..

    List the numbers 1 - 50 into A1:A48, skipping 3 and 24

    Put in B1: =RAND()
    Copy B1 down to B48

    Put in C1: =INDEX(A:A,RANK(B1,$B$1:$B$48))
    Copy C1 down to C4

    C1:C4 will return what's required

    Just press F9 to regenerate
    --
    Rgds
    Max
    xl 97
    ---
    Singapore, GMT+8
    xdemechanik
    http://savefile.com/projects/236895
    --



+ 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