+ Reply to Thread
Results 1 to 12 of 12

Generate numbers between two numbers without duplicates?

  1. #1
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Generate numbers between two numbers without duplicates?

    hello

    How can I make this ?

    If I have a group of numbers such as 10,15,18,20,28,29,30

    first: How can I generate unique numbers between the min and the max value (between 10 and 30) without duplicate any value
    second: If the min value is 10, how can I generate the numbers from Zero to that value (10), I meant How can I generate (1,2,3,4,5,6,.......9)



    Thanks

  2. #2
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: Generate numbers between two numbers without duplicates?

    Please Login or Register  to view this content.
    From what I understand you want to get the values between two other values. The above code outputs the numbers between 10 and 20 to the worksheet "Sheet1" starting in cell "A1". Is that what you need?

  3. #3
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Generate numbers between two numbers without duplicates?

    thx 111StepsAhead for rapid reply

    I'm going to try your code .....

    The purpose of what I need from that code, These random numbers are a result of filtration process for some code format and
    I need these filtered numbers to tell me suggestions for my new code, these suggestion are based on the numbers between the filtered numbers without duplicates
    and also the numbers between the smallest value (zero) and min number in filtered list

  4. #4
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Generate numbers between two numbers without duplicates?

    111StepsAhead, about ur code

    there are more of duplicates numbers generated, also there's no generation for the range (from zero to the Min value (10))

  5. #5
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: Generate numbers between two numbers without duplicates?

    Hmmmm.

    So what you really need is the numbers from 0 to the max value?

    And my code doesn't generate random numbers. It might be quicker for both of us if you upload an example workbook with what you start with and what you need to have at the end.

  6. #6
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Generate numbers between two numbers without duplicates?

    hello 111StepsAhead

    there's no use from uploading any files, but If u want, I can make one filled by numbers

    What about an example;

    If i had these filtered numbers (10,15,18,20,28,29,30), I need the numbers between the Value (Zero) and The Max Value (30) with no duplicates

  7. #7
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: Generate numbers between two numbers without duplicates?

    Ok, so you need every number from 0 to the minimum and the unique numbers in your list between the min and max that you choose? Or do you need to figure out the min and max automatically?

    Also, where are you getting the numbers from? What range in the workbook that you are using are they in?

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Generate numbers between two numbers without duplicates?

    try
    Please Login or Register  to view this content.
    Last edited by jindon; 05-15-2012 at 03:16 PM. Reason: 0 to max added

  9. #9
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Generate numbers between two numbers without duplicates?

    yes 111StepsAhead, the min and max values are automatically chosen and the numbers are result of a filtration process

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Generate numbers between two numbers without duplicates?

    hi Mamud, option, please check attachment, press "Run"
    Attached Files Attached Files
    Last edited by watersev; 05-15-2012 at 05:20 PM.

  11. #11
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Generate numbers between two numbers without duplicates?

    hello watersev,

    Working like magic, but can I add the Value "Zero" as a constant value, your code taking it in consideration

  12. #12
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Generate numbers between two numbers without duplicates?

    please check attachment
    Attached Files Attached Files

+ 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