Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
plsauditor
 
Posts: n/a
Default Validating random numbers

I need to generate a list of 10 random numbers, between 3 and 78. These
represent identification numbers of stores. However, some of those numbers
are not valid (i.e., 13, 15, 20-49,55-57). I used "randbetween" to get the
numbers between 3 and 78. I've tried various combinations of "IF" and "AND"
to screen out the numbers I don't want. Anybody have a way to do this?
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

You could put all valid numbers in A1:A41 and use:

=INDEX(A1:A41,RANDBETWEEN(1,41))

Remember, RANDBETWEEN may return the same value more than
once. To produce 10 *unique* random numbers within your
given range is a little more complex.

HTH
Jason
Atlanta, GA

-----Original Message-----
I need to generate a list of 10 random numbers, between

3 and 78. These
represent identification numbers of stores. However,

some of those numbers
are not valid (i.e., 13, 15, 20-49,55-57). I

used "randbetween" to get the
numbers between 3 and 78. I've tried various

combinations of "IF" and "AND"
to screen out the numbers I don't want. Anybody have a

way to do this?
.

  #3   Report Post  
Max
 
Posts: n/a
Default

Another option to try ..

Assuming, as per Jason's response,
the valid numbers are placed in A1:A41

Put in B1: =RAND()
Copy down to B41

Put in C1:
=INDEX(A:A,MATCH(SMALL(B:B,ROWS($A$1:A1)),B:B,0))

Copy C1 down to C10

This will return 10 random, non repeating numbers
from the list in A1:A41

(Or, just copy down to C41 to get the full lot randomly scrambled!)

Tapping F9 will recalc and re-generate afresh

Freeze the results elsewhere
with a copy paste special values OK
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"plsauditor" wrote in message
...
I need to generate a list of 10 random numbers, between 3 and 78. These
represent identification numbers of stores. However, some of those

numbers
are not valid (i.e., 13, 15, 20-49,55-57). I used "randbetween" to get

the
numbers between 3 and 78. I've tried various combinations of "IF" and

"AND"
to screen out the numbers I don't want. Anybody have a way to do this?



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
Generate random numbers 1-100 without any repeats? ExcelFan Excel Worksheet Functions 4 May 5th 23 07:46 PM
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
How do I split a column having numbers and text in a random order rana8689 Excel Worksheet Functions 2 December 17th 04 09:14 PM
Random Numbers Change? Les Coover Excel Worksheet Functions 2 December 17th 04 02:49 AM
generate random numbers Jules Excel Worksheet Functions 6 November 2nd 04 05:57 PM


All times are GMT +1. The time now is 09:34 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"