View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme[_3_] Bernard Liengme[_3_] is offline
external usenet poster
 
Posts: 1,104
Default Create a new sheet containing random sampler 200 rows over 2000

If you want to do this without using VBA:
1) On Sheet2 in A1 enter =RANDBETWEEN(1,2260) and copy down to row 200
This function needs the Analysis Toolpak; if it is not installed use
=INT(RAND()*199+1)
2) In B1 enter =INDIRECT("Sheet1!R"&$A1&"C"&COLUMN()-1,FALSE)
3) Copy this across the row; suppose on Sheet1 the last column is P, then
copy to Q
4) Copy down to row 200

Of course, you could but the random number in column Z, then in A1 use
=INDIRECT("Sheet1!R"&$Z1&"C"&COLUMN(),FALSE)

If you want the data to become static; Copy all of Sheet2 other than column
A and use Paste Special with Values specified.

As with all random number system, you may get he same row selected more than
one. If this must be avoided, you need VBA. Google with "Excel random
unique"
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Thierry Sophia-Antipolis" <Thierry
wrote in message
...
Based on a sheet containing 2260 rows I need to create a new sheet that
would
select randomly 200 rows.