+ Reply to Thread
Results 1 to 3 of 3

Random number generator, discluding specific numbers

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    Swindon
    MS-Off Ver
    Excel 2003
    Posts
    2

    Random number generator, discluding specific numbers

    For Example:

    In one case I'd like to generate 188 random numbers, all different, between 1 and 358. I need to disclude the following numbers:

    177
    198-202
    206-226
    257-263
    322
    346
    337-341
    327-335

    Any ideas?

    Thanks

  2. #2
    Registered User
    Join Date
    01-02-2013
    Location
    Swindon
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Random number generator, discluding specific numbers

    p.s. I have access to a newer version of excel if necessary

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Random number generator, discluding specific numbers

    JVesuvius,

    Welcome to the forum!
    Attached is an example file based on the criteria you described.

    There are two worksheets: 'Results' and 'Rand # Generator'
    In sheet 'Rand # Generator' in column A is this formula from A1 to A309
    Please Login or Register  to view this content.
    In that same sheet in column B is the list of legal numbers (I just used autofill to create the list, and then manually removed the numbers that aren't allowed and made it a single list with no blank cells). Then just select the numbers in column A, click on A1 and press Ctrl+Shift+Down, and go to Data -> Sort -> A-Z -> you'll prompted to expand the selection, click OK. This will cause the randomized list to sort column B by what is in column A. Then just take the first 188 results.

    In sheet 'Results' in cell A2 and copied down to cell A189 (for a total of 188 results) is this formula:
    Please Login or Register  to view this content.

    Does that work for you?
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ 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