'#1は、正しくない
'ユーザ定義関数で
'=不出現回数(25,A1:D1)
'=出現確率(25,A1:D1)
Public Function 不出現回数(v As Variant, r As Range) As Integer
Dim x As Range
Dim c As Integer, flag As Boolean
c = 0: flag = False
For Each x In r
If flag = False And x.Value >= v Then
flag = True
Else
If flag And x.Value < v Then c = c + 1
End If
Next
不出現回数 = c
End Function
Public Function 出現確率(v As Variant, r As Range) As Double
Dim x As Range
Dim c As Integer, n As Integer, flag As Boolean
c = 0: n = 0: flag = False
For Each x In r
If flag = False And x.Value >= v Then flag = True
If flag And x.Value >= v Then c = c + 1
If flag Then n = n + 1
Next
出現確率 = c / CDbl(n)
End Function
お礼
有難うございました。出来ました。完璧です。これがほしかったんです。本当に有難うです。