How to generate some random numbers for chart demo in Excel?

H

helen

I would like to know how to generate some quick random numbers in order to
use for demo purposes.
 
B

Bernard Liengme

=RAND() for numbers 0 to 1
=RANDBETWEEN(n,m) for integers; needs Analysis ToolPac

Remember the values will keep changing
You can always Copy and Paste Special with Values specified if you want to
work on a constant set of values

best wishes
 
M

Marcelo

=rand()

will return a different number between 0 and 1 when F9 is pressed.

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"helen" escreveu:
 
J

Jim Cone

Use this formula in a cell and fill down as necessary...
=Rand() * 100

The free "Special Randoms" workbook available here...
http://excelusergroup.org/media/
can generate random numbers and text in several unique ways.
--
Jim Cone
Portland, Oregon USA


"helen" <[email protected]>
wrote in message
I would like to know how to generate some quick random numbers
in order to use for demo purposes.
 
M

Mike H

helen,

This will put 50 unique random integers in column A. Right click your sheet
tab, view code and paste this in and run it

Sub No_Repeats()
Dim MyRange As Range
Set MyRange = Range("A1:A50")
For Each c In MyRange
Do
c.Value = Int((9999 * Rnd) + 1)
Loop Until WorksheetFunction.CountIf(MyRange, c.Value) < 2
Next
End Sub

Mike
 
B

Bernard Liengme

Neat code but why did you suggest making it a worksheet macro rather than a
general one?
best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Random Numbers 6
Generate random numbers 3
random numbers 3
Random number generation - with no repeats 3
excel doc 2
Random Numbers 4
Generating Random numbers. 3
random generate team 1

Top