+ Reply to Thread
Results 1 to 3 of 3

Creation of a function for random numbers with some conditions

  1. #1
    Registered User
    Join Date
    11-13-2007
    Location
    Miami, Fl USA
    MS-Off Ver
    2010
    Posts
    5

    Creation of a function for random numbers with some conditions

    Hello Everybody I was wondering if it possible to have excel create random 8 digit numbers, with the following condition: the numbers to the left and/or right of each other can not be either the number below or above. For example: 24681357 (Good) 23579135 (Bad, because 2 and 3 are consecutives). Any suggestions? Thank in advance.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Creation of a function for random numbers with some conditions

    The best you can do with formulas is to create a list of random numbers and then have a column to show which ones violate the rule. In A1 put:

    Please Login or Register  to view this content.
    In B1 put:

    Please Login or Register  to view this content.
    Copy down as far as desired. The list will change every time there is a recalc.

    A macro could generate a list of numbers that all follow the rule without showing any that violate it.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Creation of a function for random numbers with some conditions

    Here is a file that has both methods.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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