Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ed ed is offline
external usenet poster
 
Posts: 59
Default Random numbers

is there any way of only generating whole numbers within a
certain range with the rnd function
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Random numbers

Ed,

Install the Analysis Toolpack add-in
Tools - Add-ins and check off the "Analysis Toolpack".
You might need your install discs depending on your installation.

Once complete you can use the RANDBETWEEN worksheet
function, which does exactly what your asking for.

Dan E

"ed" wrote in message ...
is there any way of only generating whole numbers within a
certain range with the rnd function



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Random numbers

=Trunc(rand()*100+1)
drag fill down for as many cells as you need numbers.

will generate whole numbers (not unique) between 1 and 100 inclusive.

--
Regards,
Tom Ogilvy

"ed" wrote in message
...
is there any way of only generating whole numbers within a
certain range with the rnd function



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Random numbers


-----Original Message-----
is there any way of only generating whole numbers within

a
certain range with the rnd function
.

Let's say the range is 5 to 20

the formula would be
=round(5+(rand()*15),0)
copied over the range required.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Random numbers

This formula will generate whole numbers between 5 and 20 inclusive, but
both 5 and 20 have half the probability of occurring as the numbers 6 to 19
inclusive.

=Trunc(rand()*15+5)

will fix this.

--
Regards,
Tom Ogilvy

"Steve Lerner" wrote in message
...

-----Original Message-----
is there any way of only generating whole numbers within

a
certain range with the rnd function
.

Let's say the range is 5 to 20

the formula would be
=round(5+(rand()*15),0)
copied over the range required.



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
getting numbers divisible by 4 from random numbers in ascending order ramana Excel Worksheet Functions 6 June 19th 07 06:41 PM
I want random numbers generated without repeating numbers Johncobb Excel Worksheet Functions 2 September 7th 06 04:52 PM
Can Excel pick random numbers from 1-300 and not repeat numbers? Julian Excel Discussion (Misc queries) 1 June 7th 06 07:17 AM
Non-random numbers generated by excel's data analysis random gener Allie Excel Worksheet Functions 10 September 17th 05 06:19 AM
Non-random numbers generated by excel's data analysis random gener Harlan Grove Excel Discussion (Misc queries) 2 September 13th 05 04:06 PM


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