+ Reply to Thread
Results 1 to 6 of 6

Select Random Rows of Data

  1. #1
    Registered User
    Join Date
    06-20-2013
    Location
    KY
    MS-Off Ver
    Excel 2010
    Posts
    12

    Select Random Rows of Data

    I am using excel 2013. My sheet has 32 columns and 139 rows (we will be adding rows later). We need to randomly select 10 rows of data. This is something that we will be doing weekly.

  2. #2
    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: Select Random Rows of Data

    Hi,

    I'm attaching an example of one approach you could use. Columns A&B are two helper columns. The formula are currently set to pick 4 rows from a range of 20 so you just need to adapt the range A1:A20 and change to A1:A139 (or whatever the range is), better still of you're going to be adding rows create a dynamic range name and use that in the column B formula so that it will automatically adjust your 139 rows when necessary. And change the <=4 to <=10

    This will paint the rows yellow. If you actually want to select the rows then you could have a simple macro that selected the column B cells that contain the value Y.
    Attached Files Attached Files
    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.

  3. #3
    Registered User
    Join Date
    06-20-2013
    Location
    KY
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Select Random Rows of Data

    This was helpful, but I'm having a little trouble. I used your formula in column B, but changed the range to A2:A140. My data has headers. I'm getting a #NUM error in cell B140.

    I've also been asked to have the random data automatically go into a new sheet in the workbook.

  4. #4
    Registered User
    Join Date
    06-20-2013
    Location
    KY
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Select Random Rows of Data

    The new page should have all 32 columns of the 10 randomly selected rows.

  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: Select Random Rows of Data

    Hi,

    Rather than guessing on what your data actually looks like it would be preferable if you upload the actual workbook so that we have something concrete with which to work.

  6. #6
    Registered User
    Join Date
    06-20-2013
    Location
    KY
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Select Random Rows of Data

    I've removed personal data. My original workbook has formulas in some of the columns to calculate the number of days between dates. This one only contains values only.
    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. Select random rows from 2 or 3 sheets and display them in new Sheet
    By bhunkri in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2013, 03:46 PM
  2. Select Random Rows and Display on new sheet
    By matt4003 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 02-27-2013, 06:54 AM
  3. Replies: 2
    Last Post: 06-29-2012, 10:57 AM
  4. Select & Delete Random Consecutive Rows
    By carbonboywonder in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-04-2009, 05:28 AM
  5. Replies: 1
    Last Post: 04-23-2007, 04:23 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