+ Reply to Thread
Results 1 to 3 of 3

Help selecting random rows of data

  1. #1
    Registered User
    Join Date
    10-03-2006
    Posts
    15

    Help selecting random rows of data

    I have an excel report that I use each month exported from our access database that containes rows of data (less than 5000) that I need to choose 100 rows of data randomly from the 5000 rows of data. Any ideas??? I have been manually choosing 100 rows at random and it takes forever - I know there must be an easier way somehow...

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by hnoshea
    I have an excel report that I use each month exported from our access database that containes rows of data (less than 5000) that I need to choose 100 rows of data randomly from the 5000 rows of data. Any ideas??? I have been manually choosing 100 rows at random and it takes forever - I know there must be an easier way somehow...
    One-time setup: In a spare worksheet put 5000 (the number of available rows) in C1, and two numbers in D1 & E1 and in A2 the formula

    =OFFSET(Sheet2!$A$1,INT(MOD(($D$1*ROW())+$E$1*ROW()*2,$C$1)),COLUMN()-1)

    Formula-fill this right for the required number of columns, and then bulk-fill down for 100 rows.

    Copy the result and Paste-Special = Values to where you want the data to be.

    Remember to adjust cell C1 for the changing number of rows, and to put different pseudo random numbers in D1 and E1. note: Sheet2 = your data (report) sheet.


    note, if you want to test the row number generated set A2 with
    =INT(MOD(($D$1*ROW())+$E$1*ROW()*2,$C$1))
    and formula-fill 100 rows. The row number will 'wrap' after 5000 (C1) you may wish to avoid this.

    ---
    Last edited by Bryan Hessey; 10-03-2006 at 09:03 PM.

  3. #3
    Registered User
    Join Date
    10-03-2006
    Posts
    15

    Talking

    Thank you very much for you help!!!!

+ 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