• Status: Solved
• Priority: Medium
• Security: Public
• Views: 348

# Generate a range of integer random numbers

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)

0
WaterStreet
3 Solutions

Microsoft MVP ExcelCommented:
Hello,

something along the lines of

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

cheers, teylyn
0

Commented:
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

Microsoft MVP ExcelCommented:
You're right, Kris. My suggestion will never hit 122, it will always be below.
0

Commented:
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

Microsoft MVP ExcelCommented:
... just in case the Analysis ToolPak is not available. For e.g. in my employer's network install it isn't.
0

Commented:

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

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

Author Commented:
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

Author Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.