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

Hi

I want to be able to create a random values from a given list of values.

e.g. In column A, there are these values:
aaaa
bbbb
cccc
dddd
eeee
ffff

In another column, I want to randomly populate each cell with a value from
column A.

How can I do this?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 180
Default Need to generate random values from a list

=OFFSET($A$1,INT(RAND()*COUNTA(A:A)),0) will generate a random entry from the
list. The logic is that counta(a:a) returns the number of non-blanks from
column A. Multiply that by int(rand()*counta(a:a)) returns an integer =0
and < the number of non-blanks. The offset function goes down that many rows
from cell A1. (I've assumed the entries in column A begin in row 1 and are
continuous).
Note that the rand() function, and therefore the formula, will get updated
each time the sheet is recalculated. If you want to lock down a set of
random entries, highlight the completed column, edit copy, then edit
paste special, select values and click ok.

"Sumeet Benawra" wrote:

Hi

I want to be able to create a random values from a given list of values.

e.g. In column A, there are these values:
aaaa
bbbb
cccc
dddd
eeee
ffff

In another column, I want to randomly populate each cell with a value from
column A.

How can I do this?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Need to generate random values from a list

One play if you want it to be random but non-repeating ..

Assume source data within A1:A6

In B1: =INDEX(A:A,RANK(C1,$C$1:$C$6))
In C1: =RAND()
Select B1:C1, fill down to C6

B1:B6 will return a random shuffle of what's in A1:A6
Each press of the F9 key will regenerate a fresh shuffle
(Hide away col C, if necess)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Sumeet Benawra" wrote:
Hi

I want to be able to create a random values from a given list of values.

e.g. In column A, there are these values:
aaaa
bbbb
cccc
dddd
eeee
ffff

In another column, I want to randomly populate each cell with a value from
column A.

How can I do this?

Thanks

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
list unique values in a column beechum1 Excel Worksheet Functions 1 March 2nd 06 05:08 AM
How to eliminate xero values from pivot table and list top 10 only Dinesh Excel Worksheet Functions 0 February 19th 06 03:48 AM
Random items from a list? arcngel Excel Discussion (Misc queries) 3 September 8th 05 06:04 PM
Count unique values and create list based on these values vipa2000 Excel Worksheet Functions 7 August 5th 05 01:17 AM
Generate random numbers between two values and with a given mean pinosan Excel Worksheet Functions 2 March 7th 05 02:04 PM


All times are GMT +1. The time now is 10:45 PM.

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"