Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Roger H.
 
Posts: n/a
Default Randomly choosing

Hello. I have a rather tricky problem that I have not been able to untangle.
Situation: I have a group of numbers in column A that range from zero up to
999 in value. These numbers are randomly distributed. I have another group
of numbers that also range from zero to 999 in column B.

Starting with the value in A1, I want to RANDOMLY choose any value from
column B, such that, the value that is chosen depends in some way on the
value in A1. I tried =INDEX(B1:B1000, A1, 1) and copied down. For general
purposes with no restrictions, this works. But when the value in A1 is
repeated later in column A, this gives me the same number as before that was
chosen from column B. For my purposes, this is unacceptable.

To conclude, I need each individual value in A to pluck a number from zero
to 999 from B without forced duplication because of the numerical value
itself in column A. In other words, the second occurence of any number in A
will be free to choose a different number from B than before.It seems that
this will required a combination of formulas. Thank you.......Roger H.


  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Roger,

Perhaps you could enter the numbers 0-999 into B1:B1000, enter the formula
=RAND()
into cells C1:C1000, and sort B1:C1000 based on column C. That will
randomize the numbers in column B and prevent duplicates.

I must say that I don't know if that will solve your problem, which was a
bit confusingly stated.

HTH,
Bernie
MS Excel MVP

"Roger H." wrote in message
...
Hello. I have a rather tricky problem that I have not been able to

untangle.
Situation: I have a group of numbers in column A that range from zero up

to
999 in value. These numbers are randomly distributed. I have another group
of numbers that also range from zero to 999 in column B.

Starting with the value in A1, I want to RANDOMLY choose any value from
column B, such that, the value that is chosen depends in some way on the
value in A1. I tried =INDEX(B1:B1000, A1, 1) and copied down. For general
purposes with no restrictions, this works. But when the value in A1 is
repeated later in column A, this gives me the same number as before that

was
chosen from column B. For my purposes, this is unacceptable.

To conclude, I need each individual value in A to pluck a number from zero
to 999 from B without forced duplication because of the numerical value
itself in column A. In other words, the second occurence of any number in

A
will be free to choose a different number from B than before.It seems that
this will required a combination of formulas. Thank you.......Roger H.




  #3   Report Post  
Peter Rooney
 
Posts: n/a
Default

Roger,

If you want to generate random numbers between 1 and 999, try

=int(rand()*1000)

and copying the formula into as many rows as you need

Cheers & hope this helps

Pete


"Roger H." wrote:

Hello. I have a rather tricky problem that I have not been able to untangle.
Situation: I have a group of numbers in column A that range from zero up to
999 in value. These numbers are randomly distributed. I have another group
of numbers that also range from zero to 999 in column B.

Starting with the value in A1, I want to RANDOMLY choose any value from
column B, such that, the value that is chosen depends in some way on the
value in A1. I tried =INDEX(B1:B1000, A1, 1) and copied down. For general
purposes with no restrictions, this works. But when the value in A1 is
repeated later in column A, this gives me the same number as before that was
chosen from column B. For my purposes, this is unacceptable.

To conclude, I need each individual value in A to pluck a number from zero
to 999 from B without forced duplication because of the numerical value
itself in column A. In other words, the second occurence of any number in A
will be free to choose a different number from B than before.It seems that
this will required a combination of formulas. Thank you.......Roger H.



  #4   Report Post  
Myrna Larson
 
Posts: n/a
Default

Slight correction: your formula gives RNs in the range 0 to 999, rather than
1-999

On Mon, 7 Mar 2005 07:05:06 -0800, Peter Rooney
wrote:

Roger,

If you want to generate random numbers between 1 and 999, try

=int(rand()*1000)

and copying the formula into as many rows as you need

Cheers & hope this helps

Pete


"Roger H." wrote:

Hello. I have a rather tricky problem that I have not been able to

untangle.
Situation: I have a group of numbers in column A that range from zero up to
999 in value. These numbers are randomly distributed. I have another group
of numbers that also range from zero to 999 in column B.

Starting with the value in A1, I want to RANDOMLY choose any value from
column B, such that, the value that is chosen depends in some way on the
value in A1. I tried =INDEX(B1:B1000, A1, 1) and copied down. For general
purposes with no restrictions, this works. But when the value in A1 is
repeated later in column A, this gives me the same number as before that

was
chosen from column B. For my purposes, this is unacceptable.

To conclude, I need each individual value in A to pluck a number from zero
to 999 from B without forced duplication because of the numerical value
itself in column A. In other words, the second occurence of any number in A
will be free to choose a different number from B than before.It seems that
this will required a combination of formulas. Thank you.......Roger H.




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
How do i sort rows randomly? Jeremy Excel Discussion (Misc queries) 5 December 12th 07 01:03 PM
Choosing a date Dawn Excel Worksheet Functions 4 February 28th 05 10:46 PM
i have fields that are formatted for text that randomly convert t. dave glynn Excel Discussion (Misc queries) 2 February 22nd 05 09:03 PM
Excel formula randomly changes to hard-code number Ned Excel Discussion (Misc queries) 3 February 14th 05 11:31 PM
How can I generate 10 sites randomly from a worksheet isankar Excel Discussion (Misc queries) 6 December 22nd 04 09:14 PM


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

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

About Us

"It's about Microsoft Excel"