Defaulting a random number

P

Pozman

Hi

I am developing an AFL football score calculator using the RAND
function.

Is there a function that can default a cell to "0" after a random
number has been created.

I use F9 to do the random number, is there a formula or funtion that I
can use to default that cell?

Any help is appreciated, thanks in advance.
 
O

oldchippy

Pozman said:
Hi

I am developing an AFL football score calculator using the RAND
function.

Is there a function that can default a cell to "0" after a random
number has been created.

I use F9 to do the random number, is there a formula or funtion that I
can use to default that cell?

Any help is appreciated, thanks in advance.
Hi Pozman,

I assume you want the "0" in another cell?

Try something like this in cell B1

=IF(A1>0,0,"") if your random number is in A1, B1 will be 0, otherwise
nothing

Alter cell ref's to suit

Is this what you are looking for?

oldchippy :confused:
 
P

Pozman

Hi Old Chippy

Sorry for the late reply and thanks for taking the time to help me
out.

What Im looking to create is a random sports calculator.

Say for example you wanted to make one for soccer. You would start by
putting two teams in then hitting F9 to produce a random score using
the RAND function.

Then if you wante to play again you would have another key/funtion that
would reset the scores to 0 - 0 in that same cell.

Then the process is repeated. It is a situation that is probably best
suited for something like visual basic, but I dont have it or know how
to use it. So I'd really like to be able to create it in exel.

If you can help anymore thats great and thanks heaps.

Cheers
 
O

oldchippy

OK :confused:

If I understand correctly, try something like this,

Record a marco – Tools > Macro > Record new macro

Macro1 > Select store in this workbook, then OK

Click cell A1, input =RAND()
Click cell B1, input =RAND()

Stop marco recording

Now record macro2

Record a marco – Tools > Macro > Record new macro

Macro2 > Select store in this workbook, then OK

Click cell A1, input 0
Click cell B1, input 0

Stop marco recording

Now - View > Toolbars > Forms

Click on the "button" icon and draw one on your spreadsheet (Button 1)
the Assign macro box opens – select Macro1 > OK

Now do the same for Macro2

Click button 1 for random numbers
Click button 2 for 0’s

oldchippy :cool
 

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