+ Reply to Thread
Results 1 to 9 of 9

How to Generate Randomnumbers Without duplicating any 3 numbers?

  1. #1
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Question How to Generate Randomnumbers Without duplicating any 3 numbers?

    Good Morning,
    I’ve been looking for numbergenaretor to give me a set of 8 rows random numbers and in each row consist of 5 numbers.But the trick is to to repeat this process for 15 times one blank row between each set and also not to duplicate any 3 numbers from previous rows and sets,is that possible with macro?
    Lover value=1,upper value =40,numbers per row =5 ,number of rows per set =8
    In my attachment the numbers in red in first set are repeated in the second set that is not acceptable but any two numbers if duplicated its OK.
    In short, I do not want any 3 numbers to be duplicated in 15 set.
    I would very much appreciate any help and suggestions.
    Sem
    Attached Files Attached Files

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: How to Generate Randomnumbers Without duplicating any 3 numbers?

    Hello sem,

    See this link:http://www.google.co.za/url?sa=t&rct...52434380,d.d2k
    Last edited by Winon; 09-20-2013 at 04:28 AM. Reason: Spelling
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: How to Generate Randomnumbers Without duplicating any 3 numbers?

    Good morning Winon,
    Thanks for your time, but that link does not help me .I'm looking for VB code solution.
    Anyway much appreciated.
    sem

  4. #4
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: How to Generate Randomnumbers Without duplicating any 3 numbers?

    I would much appreciate for any other suggestion,please.
    Thanks
    sem

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: How to Generate Randomnumbers Without duplicating any 3 numbers?

    Hello sem,

    I don't think what you are asking, is possible. Firstly, you specify a minimum level of 1, with a maximum of 40, within a range of 40 Cells. Within each of the fifteen sets, all of the 40 Cells will be populated with 40 Random Numbers between 1 and 40. To then check for duplicates in these 15 sets of data, would require Coding to allow for +-1800 permutations, making it just about impossible.

    In your example presented to the Forum, you show in red, "Duplicates" as numbers, 2, 5, 24 and, 14,15 and 22. Yet you have numbers in Green as, 8, 17, 30 and 34, which you don't consider as "Duplicates". I don't know how the system should ignore either, numbers 8, 17 and 30, or 17, 30 and 34, as not being "Duplicates". The same goes for many other permutations of those very same numbers,i.e: 8, 30 and 34, or 8, 17 and 34, etc.

    Maybe you should rethink this issue first, and consider a totally different approach.

    I hope you get the "picture"

  6. #6
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: How to Generate Randomnumbers Without duplicating any 3 numbers?

    Hi Winon,
    Very sorry for delayed response.
    I might be not clear about duplicate,the number in red are trios those are not to be duplicated as for the pairs(green) it OK if duplicated.
    Thanks for your time .
    sem

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: How to Generate Randomnumbers Without duplicating any 3 numbers?

    Hello sem,

    Again,

    I don't know how the system should ignore either, numbers 8, 17 and 30, or 17, 30 and 34, as not being "Duplicates". The same goes for many other permutations of those very same numbers,i.e: 8, 30 and 34, or 8, 17 and 34, etc.
    I am afraid that I cannot help you with this request. It just will not be possible to Code in such a way where the system should decide what are pairs,that are okay and, which "Triplicates" are "Duplicates" and what not.

    Regards
    Last edited by Winon; 09-25-2013 at 03:57 AM. Reason: Spelling

  8. #8
    Forum Contributor
    Join Date
    01-21-2011
    Location
    London,UK
    MS-Off Ver
    Excel 2007
    Posts
    241

    Re: How to Generate Randomnumbers Without duplicating any 3 numbers?

    Hi Winon,
    Thanks for your time.After a long search and recording macro i come up with this code, it can give me hundreds of sets, but i can not find
    to check and prevent duplicate trios.So i would much appreciate for any help on that.
    here is the code;
    Please Login or Register  to view this content.
    kind regards
    sem

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: How to Generate Randomnumbers Without duplicating any 3 numbers?

    Hello sem,

    ...but i can not find to check and prevent duplicate trios
    And you will never be able to. As I have said in my previous posts, it is impossible to Code in such a way, where the system has to identify "Trios" as duplicates, while you want to allow "Pairs" as not being seen as duplicates. For every two pairs of numbers, there are multiple combinations of "Trios", which the system will identify as "Duplicates". Thus defeating your objective.

    If ever, which a strongly doubt, you do find a solution for this, then I would love to see it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. RandomNumbers & Letters w/o Duplicates
    By pilotjourney in forum Excel General
    Replies: 2
    Last Post: 09-16-2010, 09:35 AM
  2. how can I activate a 'numbers' duplicating prompt (help)
    By Paul B in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  3. how can I activate a 'numbers' duplicating prompt (help)
    By Paul B in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  4. how can I activate a 'numbers' duplicating prompt (help)
    By Earl in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  5. how can I activate a 'numbers' duplicating prompt (help)
    By Earl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-13-2005, 07:48 AM

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