+ Reply to Thread
Results 1 to 7 of 7

Generate random numbers with no repeats?

  1. #1
    Registered User
    Join Date
    03-12-2017
    Location
    New Zealand
    MS-Off Ver
    2013
    Posts
    25

    Generate random numbers with no repeats?

    Hi

    I want to generate a column of random numbers between 1 and 312
    I then want to create a column next to that one also generating a random number between 1 and 312 but cannot use the number in the previous cell.
    I want to do this for multiple columns with no repeat on any single row.
    How can this be achieved?
    Thanks

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

    Re: Generate random numbers with no repeats?

    Hi,
    Make column A numbers 1 to 132. Make column B =Rand(). Sort by column B.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    03-12-2017
    Location
    New Zealand
    MS-Off Ver
    2013
    Posts
    25

    Re: Generate random numbers with no repeats?

    Hi, thanks for your response

    However, I don't see how your solution achieves my goal?
    Unless I am missing something....

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Generate random numbers with no repeats?

    hi there. try this array formula in cell B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    a similar eg is explained in the file of my link below*Tips & Tutorials I Compiled, sheet 57. it is in ROWS instead while yours is in columns. it also returns a bunch of text available in a column while yours is purely numbers from 1 to 312.
    Attached Files Attached Files

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Generate random numbers with no repeats?

    Can numbers be the same in a column?
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-12-2017
    Location
    New Zealand
    MS-Off Ver
    2013
    Posts
    25

    Re: Generate random numbers with no repeats?

    Quote Originally Posted by tim201110 View Post
    Can numbers be the same in a column?
    they sure can!

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

    Re: Generate random numbers with no repeats?

    Hi limpfisch,

    You didn't like my answer last night so here is the workbook showing what I meant.

    Random Numbers No Repeats.xlsx

    You start by creating the numbers in Column A then you sort them randomly, using Column B. If you need a better answer, you should supply a sample workbook.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

+ 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: 9
    Last Post: 05-03-2016, 04:43 PM
  2. VBA random numbers NO repeats
    By jamiegfinch in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-18-2015, 12:01 AM
  3. [SOLVED] Generate random comma separated lines of text from list without repeats
    By Banker123456 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-12-2014, 12:00 AM
  4. [SOLVED] Generating Random Numbers between Upper & Lower Limits and without Repeats.
    By e4excel in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-17-2012, 09:42 AM
  5. Replies: 3
    Last Post: 03-21-2010, 09:04 PM
  6. Generate random numbers with no repeats
    By Paul Sheppard in forum Excel General
    Replies: 4
    Last Post: 04-06-2007, 12:37 PM
  7. code not working properly - VBA beginner (random numbers generation, no repeats)
    By msburza in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-11-2006, 01:10 PM

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