Dear All,

I am new to VBA and am stuck on trying to find the mean of a range of values outputted by the following code:

' Create storage for FTSE100 and binary payoff simulations.
ReDim IndexSim(1 To SampleSz) As Double
ReDim Payoff(1 To SampleSz) As Double

'Do the simulations.
For Cnt = 1 To SampleSz
IndexSim(Cnt) = gBmProcess(Kt, r, q, Vol, TMat - TNow)

If IndexSim(Cnt) >= IndexBetValue Then
Payoff(Cnt) = Range("D18").Value
Else
Payoff(Cnt) = Range("D19").Value
End If



Next Cnt

The first and last parts of the code have been omitted, but please could somebody help me to attempt to find the mean of the IndexSim and Payoff values outputted by the function.

Many thanks,

Suz