+ Reply to Thread
Results 1 to 16 of 16

How to pick 50 numbers randomly

  1. #1
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    How to pick 50 numbers randomly

    Hi,

    In sheet1 columnA I have some data from that i want to copy randomly 50 rows to sheet2. Please help me is there any formula to do this


    Thank You

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: How to pick 50 numbers randomly

    Try this in Sheet2 (From 2nd row!)

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by zbor; 12-11-2013 at 04:21 AM.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to pick 50 numbers randomly

    It would be easier if we could see your data, and know whether it has to remain in place or not.

    However one way. Add a helper column next to your data and populate it with =RAND()

    Then sort all your data using the Rand column as the key then just copy the to 50 rows and paste to sheet2.

    You could put all that together in a macro if you're repeating it many times.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: How to pick 50 numbers randomly

    Thanks for your immediate response,

    I will explain clearly

    In my attached file in column A i have some numbers from A2 to A452 from this sheet i want to copy 50 numbers (randomly) to sheet2, but this not one time exercise i have to do this for more than 100 excel files, each excel file is having different number of rows minimum number of rows is 50 maximum is 1000. means one excel file is having only 150 rows, another excel file is having 600 rows like that each excel file is having different number of rows. but from each file i want 50 random numbers.

    I think i explained clearly

    Thank you
    Attached Files Attached Files

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to pick 50 numbers randomly

    Hi,

    Have you tried either of the answers you've been given?

    Zbor's answer should work with any data.

  6. #6
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: How to pick 50 numbers randomly

    I tried Zbor's but in all rows it is showing '0' only not getting any value

    Thank u

  7. #7
    Forum Contributor
    Join Date
    12-09-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    171

    Re: How to pick 50 numbers randomly

    Hi Nalini,

    I hope you are trying to put the formula in Column A of Sheet2... if you do like that you will get circular error and returns ZERO.

    Hence please try to put the formula in Column B with the following formula from Mr. Zbor..

    =INDEX(Sheet1!A:A,RANDBETWEEN(1,COUNTA(Sheet1!A:A)))

    But, this will gives you duplicate numbers. I suggest to have a macro for this as suggested by Mr. Richard.

    I do same kind of activity for random quality sampling..

    Please let me know, if you need help in having the macro created for you problem...

    Thanks,
    BP

  8. #8
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: How to pick 50 numbers randomly

    Thank you so much it is working, but I dont want the out put as numbers, means in my excel file i have given some 'IDs' in ColumnA from that I want to take 50 IDs randomly and put it in sheet2, the number of rows in each file is not same (minimum 50 and maximum 1000)

    Please help me is there any formula to pick only 50 samples from the given set

    Thank you

  9. #9
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: How to pick 50 numbers randomly

    Thank you so much it is working, but I dont want the out put as numbers, means in my excel file i have given some 'IDs' in ColumnA from that I want to take 50 IDs randomly and put it in sheet2, like this I have 100 files the number of rows in each file is not same (minimum 50 and maximum 1000)

    Please help me is there any formula to pick only 50 samples from the given set

    Thank you

  10. #10
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: How to pick 50 numbers randomly

    Hi,

    I need the selected rows to be displayed in sheet2. The idea being that I have Employees data in sheet1 with hundreds of IDs and I only want a random selection of 50 IDs to appear in sheet2 in excel

    Please help me is there any formula to do this excercise

    Thank you

  11. #11
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: How to pick 50 numbers randomly

    Column A: Employee ID
    Column B: =RANDBETWEEN(1,COUNTA(A:A)-1)
    Column C: =IF(RANK.AVG(B2,B:B)<51,A2,"")

    this will show you, in column C, the Top 50.

  12. #12
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: How to pick 50 numbers randomly

    Hi,

    This is working but out put is not coming what I am expecting.

    If this is not possible please tell me how to pick first 50 rows from sheet1 and put it in sheet2

    Thanks you

  13. #13
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to pick 50 numbers randomly

    Is post #3 not an option if you're having difficulty with the other suggestions?

  14. #14
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: How to pick 50 numbers randomly

    create a Module and paste the following code. then you would need to run the Macro Top50Numbers (Alt+F8) then select the Top50Numbers and click Run.
    Do not forget to save the file as XLSM (Macro Enabled WorkSheet)

    Please Login or Register  to view this content.
    Click on the star if you think I helped you

  15. #15
    Registered User
    Join Date
    03-06-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: How to pick 50 numbers randomly

    Hi,

    Please help me how to pick 50 values randomly from sheet1 column A and put it in sheet2 Column A

    Please help me is there any formula to do this

    Thank you

  16. #16
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to pick 50 numbers randomly

    See Attached.

    I still can't help thinking that a simple macro that first sorts the data plus a RAND column on the Rand value and then copies the first 50 records to sheet 2 is simpler
    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)

Similar Threads

  1. Pick 2 numbers randomly from list and iterate
    By mrtn88 in forum Excel General
    Replies: 1
    Last Post: 07-10-2012, 10:25 AM
  2. I have a column full of names and need to randomly pick 300 of them.
    By JoseK70 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-22-2011, 08:17 PM
  3. Program to randomly selecting numbers from a group of numbers
    By flexalong in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2008, 04:22 AM
  4. Macro to randomly pick data and insert, is there one?
    By ntrcptr in forum Excel General
    Replies: 1
    Last Post: 04-03-2007, 03:50 PM
  5. [SOLVED] to find missing serial numbers in randomly generated numbers
    By B.H. Hadi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-01-2005, 07:00 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