Solved

Generate a range of integer random numbers

Posted on 2013-02-05
8
338 Views
Last Modified: 2013-02-05
What formula or combination of formulas can I insert into a large Excel table in order to generate a random integer number for each cell in the range of 65 to 122?  Duplicates expected.

(Using Excel 2003 where x = the number of cols and y = the number of rows)

Thanks in advance.
0
Comment
Question by:WaterStreet
8 Comments
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 38854239
Hello,

something along the lines of

=INT(RAND()*(122-65)+65)

cheers, teylyn
0
 
LVL 7

Accepted Solution

by:
leptonka earned 275 total points
ID: 38854251
Hi,

I think to have the correct intervall (including 65 and 122) you should add +1:
=INT(RAND()*(122-65+1)+65)

Cheers,
Kris
0
 
LVL 50

Assisted Solution

by:Ingeborg Hawighorst
Ingeborg Hawighorst earned 175 total points
ID: 38854261
You're right, Kris. My suggestion will never hit 122, it will always be below.
0
 
LVL 24

Assisted Solution

by:Steve
Steve earned 50 total points
ID: 38854481
Can you not just use RANDBETWEEN

=RANDBETWEEN(65,122)

If this function is not available, and returns the #NAME? error, install and load the Analysis ToolPak add-in.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 38854493
... just in case the Analysis ToolPak is not available. For e.g. in my employer's network install it isn't.
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 38854746
No points, please :)

For Excel 2007+ users, RANDBETWEEN no longer requires the Analysis ToolPak.

I know this does not help WaterStreet right now...
0
 
LVL 18

Author Closing Comment

by:WaterStreet
ID: 38857259
Wow!  Thanks everyone.  

I'd be embarrassed to say how many hours I wasted trying to figure this out, until I got too tired and then remembered EE.

I have another question that is really the second half of my project's problem.  Don't answer it here, because I will post it as a new question in this Zone.  

If you're interested then think about how I would use the Accepted Solution to generate a table of integer random numbers in the specified range, like here, but where there are (let's say 3) Sub Ranges within -- that each have a specified weight/bias (Bias) for appearing in the table.  

I'll try to notify you here when I ask the new question.

Thanks
0
 
LVL 18

Author Comment

by:WaterStreet
ID: 38857856
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now