# Thread: Fake Data from Rand() (WinXP XL2002)

1. ## Fake Data from Rand() (WinXP XL2002)

in order to test a workbook which deals with students exam results, I want to create a column of many percent scores. Can Rand() be used to create a large number of 'fake' results, being two digit intergers (1 to 99)? Thanks

2. ## Re: Fake Data from Rand() (WinXP XL2002)

You can use
<code>
=INT(99*RAND()+1)
</code>
Keep in mind that the values will be recalculated each time the sheet is recalculated, unless you turn off automatic recalculation, or replace the formulas with their values.

Hans

4. ## Re: Fake Data from Rand() (WinXP XL2002)

If you have the analysis toolpack that comes with Excel installed, you can insert the formula below in a cell and copy it wherever it is needed:

<code>
=RANDBETWEEN(1,99)
</code>

If you don't want to install the analysis toolpack, you can use:

<code>
=INT(RAND()*(99-1)+1)
</code>

5. ## Re: Fake Data from Rand() (WinXP XL2002)

<img src=/S/hello.gif border=0 alt=hello width=25 height=29> Frank

Sure!

Try this and see if you like it:

=(RAND()*(99-1)+1)/100. Make the cell format that you have this formula in as 0% and you should be up and running. tailor to your needs in terms of how many digits after the decimal point, or any errors that you may want to exclude.

My question to you, why only 99 <img src=/S/duck.gif border=0 alt=duck width=23 height=23>? You do not give A+ <img src=/S/clever.gif border=0 alt=clever width=15 height=15>

Wassim

6. ## Re: Fake Data from Rand() (WinXP XL2002)

One function you may want to look at: RANDBETWEEN(). With this, you can set a low number and a high number...1 and 99. You can then format the individual cells so the result appears the way you like.

To use the function RAND, you could try this: <font color=blue> =ROUND(RAND()*100),0). </font color=blue>

7. ## Re: Fake Data from Rand() (WinXP XL2002)

Thanks to Legare and Wassim as well - all workable methods.

Wassim - This is dummy data for testing, in real life, a student with 100% would get an A++ because the next column contains =IF(R1>89,"A++",IF(R1>79,"A+", IF(R1>69,"A",IF(R1>59,"D","F")))) Where R1 is the range containing the percentage . It was in order to test this formula that I needed the dummy data, our students are marked in sets of usually five percent stages, so a poor student may get either 35% or 40% or 45% and be given a letter grade accordingly.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•