+ Reply to Thread
Results 1 to 5 of 5

How to generate non-repeating random numbers in a column wihtout VB

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Smile How to generate non-repeating random numbers in a column wihtout VB

    I have a column of 10 cells and would like to fill each cell with random numbers between 1 and 10 without any of these 10 numbers being generated more than once. Is that possible to do without VB?

    Thank you.
    Last edited by luv2glyd; 02-16-2015 at 12:43 AM.
    You either quit or become really good at it. There are no other choices.

  2. #2
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: How to generate non-repeating random numbers in a column wihtout VB

    http://answers.microsoft.com/en-us/o...a-61b68c9daafe
    Please consider adding a * if I helped.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: How to generate non-repeating random numbers in a column wihtout VB

    Hi,

    No problem if you create a column next to the number of random numbers. Then sort by the random column. See the attached. No VBA needed. You do need to press F9 to refresh the Random numbers and then Sort by that column.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    01-30-2013
    Location
    Hobart, TAS
    MS-Off Ver
    Office 2003, XL2007
    Posts
    46

    Re: How to generate non-repeating random numbers in a column wihtout VB

    Hi there

    Cel A1 =RAND()
    Cell B1 =RANK(A1,$A$1:$A$10)
    Copy both cells down to row 10

    If generated numbers required permanently copy col B cells to an unused area and Paste special>Values.

    Use F9 key to generate new list.

    HTH

  5. #5
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: How to generate non-repeating random numbers in a column wihtout VB

    Thank you all for the advice. I can only have one column dedicated to random number generation, and have to paste it several hundred times, and also vary the number of rows from 10 through 40. So what looks to work best is the first answer with that complex formula in each cell. Thanks again.

    Here's a copy of that post for historical record in case the link above dies. This generates 33 non-repeating random numbers:

    ------------------------------
    You could use an array formula to achieve this:



    Enter your heading in cell A1

    Enter the formula =RANDBETWEEN(101,133) in cell A2

    Enter this array formula in cell A3:

    =LARGE(ROW($101:$133)*NOT(COUNTIF($A$2:A2,ROW($101:$133))),RANDBETWEEN(1,(133+2-101)-ROW(A2)))

    (press CTRL+SHIFT+ENTER to enter this as an array formula)

    Now copy cell A3 down for as many rows as you require values and they should all be unique.

    You can substitute the 101 and 133 in the above formula for any maximum and minimum values you want to use.

    -----------------------------------
    Last edited by luv2glyd; 02-16-2015 at 12:47 AM.

+ 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. Replies: 8
    Last Post: 11-18-2013, 04:24 PM
  2. How to generate non-repeating random numbers
    By luv2glyd in forum Excel General
    Replies: 2
    Last Post: 09-24-2010, 12:16 PM
  3. I want random numbers generated without repeating
    By Johncobb45 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-08-2006, 08:53 PM
  4. using excel generate random numbers 1 to 52 without repeating
    By Norman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-24-2006, 02:25 AM
  5. [SOLVED] How do I generate random, non-repeating numbers that don't change?
    By bsquared0 in forum Excel General
    Replies: 1
    Last Post: 07-30-2005, 12:05 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