Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Unique random numbers from list

I would like to create a function that would put 5 random numbers from
a list. The list is in cells A5:A105 and the five random selections
can go in B5:B9. I'm using the formula:

=INDEX(A:A,RAND()*COUNTA(A:A))

This formula does work most of the time but does not guarantee that
the five random selections are unique. Any ideas on how this can be
done?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Unique random numbers from list

You're saying that you have 101 numbers in your list.

In an out of the way location on you sheet, say Z1 to Z101, enter the Rand
function.
In Z1 enter,
=Rand()
And copy down to Z101.

Then in B5, enter this formula:

=INDEX(A$5:A$105,RANK(Z1,Z$1:Z$101))

And copy down to B9.

This will give you a random selection from your list, "without replacement",
meaning ... no duplicates.

You will get a new random selection with every hit of <F9.

You could make your calc mode "manual", so that you don't inadvertently
refresh you random selection.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Matt" wrote in message
...
I would like to create a function that would put 5 random numbers from
a list. The list is in cells A5:A105 and the five random selections
can go in B5:B9. I'm using the formula:

=INDEX(A:A,RAND()*COUNTA(A:A))

This formula does work most of the time but does not guarantee that
the five random selections are unique. Any ideas on how this can be
done?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,091
Default Unique random numbers from list

Are the numbers in A5:A105 unique -i.e. no duplicates?

Tyro

"Matt" wrote in message
...
I would like to create a function that would put 5 random numbers from
a list. The list is in cells A5:A105 and the five random selections
can go in B5:B9. I'm using the formula:

=INDEX(A:A,RAND()*COUNTA(A:A))

This formula does work most of the time but does not guarantee that
the five random selections are unique. Any ideas on how this can be
done?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Unique random numbers from list

That is correct. There are no duplicates in the original list.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unique RANDOM NUMBERS within specified range Matt D Francis Excel Worksheet Functions 5 July 15th 08 08:04 PM
how to identify unique list of 200 random entries from a list of 3 tjb Excel Worksheet Functions 3 August 13th 07 02:15 PM
how to extract unique numbers once from a list of repeated numbers? [email protected] Excel Discussion (Misc queries) 2 May 2nd 06 04:17 PM
generate unique random numbers Stephen Larivee New Users to Excel 7 March 29th 06 01:04 AM
Random list (1-45) without repeating numbers? Hayes Excel Worksheet Functions 1 November 21st 04 10:01 PM


All times are GMT +1. The time now is 05:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"