Function Help - List of RANDBETWEEN results

  • Thread starter Thread starter mgrob
  • Start date Start date
M

mgrob

I am wanting to be able to create a a list of results from the number
generated by the RANDBETWEEN function. I am hoping to be able to lis
these as a table of results. Can anyone help??

The randbetween function randomly generates a number into a singl
cell. I want to record each number it generates into a list.

Thank
 
Can you not enter this in A1:

=RANDBETWEEN(low, high)

and copy down as far as necessary (replacing low and high with your
range, of course)?
 
Sorry if I am vague,

Not sure how to put it..

I want to be able to record the various numbers that are generetaed b
the RANDBETWEEN function so I can anaylse the results. eg. If I was t
use this function to simulate tossing a coin, I want to list th
results.eg Heads or Tails.

H
T
T
H
T
H
H

I want to be able to generate each event with the recalculation of th
cell with the randbetween function.

Example. A1 contains the formula. However a list of results start
at A2 and continues down A3,A4,A5,A6.


Does this help?

Thank
 
Sorry if I am vague,

Not sure how to put it..

I want to be able to record the various numbers that are generetaed b
the RANDBETWEEN function so I can anaylse the results. eg. If I was t
use this function to simulate tossing a coin, I want to list th
results.eg Heads or Tails.

H
T
T
H
T
H
H


So what I want to do is each time the function is recalculated, I wan
to have a list of the previous results.

It is important that each is a seperate event not just as simple a
filling down...unfortunetely

So with the formula in A1, I want a listing of the results in A3, A4
A5, A6 and so on....

Thanks again,

Mar
 
Maybe you can use something in here:

Option Explicit
Sub testme()

Dim myRng As Range
Dim wks As Worksheet
Dim iCtr As Long
Dim calcMode As Long

calcMode = Application.Calculation
Application.Calculation = xlCalculationManual

Set wks = Worksheets.Add

With wks

.Range("A1").Resize(1, 4).Value _
= Array("H/T", "Attempt", "#H", "#T")

Set myRng = .Range("a2:a51")
myRng.Formula = "=IF(RAND()<0.5,""H"",""T"")"

For iCtr = 1 To 50
Application.Calculate
With .Cells(iCtr + 1, "B")
.Value = iCtr
.Offset(0, 1).Value = Application.CountIf(myRng, "H")
.Offset(0, 2).Value = Application.CountIf(myRng, "T")
End With
Next iCtr

.UsedRange.Columns.AutoFit

End With

Application.Calculation = calcMode

End Sub
 

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

Back
Top