Data Analysis: Random Numbers

A

Andrea

Hello,

I'm using Office XP with Windows 98SE and trying to create random numbers on
an Excel worksheet. I don't understand what to put in the dialogue box from
the data analysis add-in for generating random numbers.

My worksheet has a list of names. The other columns contain data about these
names, but it's only the names that I'm concerned with right now. I want to
generate random numbers for all of them. I've added a new column in which to
generate these numbers, but I don't understand how to fill in the dialogue
box. The help menu doesn't help! Here are the items: number of variables,
number of random numbers (the total of numbers I need to generate?),
distribution, parameters: input range, random seed, output range. Please
help! TIA.
 
A

Andrea

OK, instead of using the Add-in, I generated random numbers with the =RAND()
command. That seems to have worked, but all of the numbers have decimals.
That's okay, but I'm wondering why. Also, some of the numbers don't have as
many places to the right of the decimal (one less).

The real problem is that I can't sort this column in either ascending or
descending order. I select it, go to Data, Sort and am asked if I want to
expand the selection. (Otherwise, I can't do it because my cells aren't of
identical size. I think I need to expand though so that the other columns
move along with the sorted column, don't I?) So I click OK to expand the
selection and it sorts, but the numbers aren't in chronological order. For
example, I have 0.6x, then 0.4x, then 0.5x. then 0.4x. You get the idea. I
don't know what criterion Excel used to sort these numbers. What am I doing
wrong?
 
J

Jerry W. Lewis

By definition RAND() generates decimal fractions uniformly between 0 and 1.

When you sort, Excel sorts correctly based on the pre-sort values, but
RAND() is a volatile function, so after the sort, it generates new
random numbers, which will not be sorted. This is convenient if you
want to re-order things several times. If you only want to do it once,
generate the numbers, then copy and Edit|Paste Special|Values to prevent
them from changing after sorting.

Jerry
 
A

Andrea

Thank you so much! That worked perfectly!

Jerry W. Lewis said:
By definition RAND() generates decimal fractions uniformly between 0 and 1.

When you sort, Excel sorts correctly based on the pre-sort values, but
RAND() is a volatile function, so after the sort, it generates new
random numbers, which will not be sorted. This is convenient if you
want to re-order things several times. If you only want to do it once,
generate the numbers, then copy and Edit|Paste Special|Values to prevent
them from changing after sorting.

Jerry
 

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

Top