Hier mal mein Ansatz für die Standardabweichung ( der nicht funktioniert). In Zeile A1:A147000 steht das Datum in dd/mm/yyyy. Ich vergleiche nun, ab wann mm/YYYY nicht mehr übereinstimmt. Falls es nicht mehr übereinstimmt soll die STD (sd) über die Zellen gebildet werden, die bis dahin übereinstimmten. Wer kann mich unterstützen?
Dim j As Integer
Dim hilf As Integer
Dim f As Double
Dim i As Double
Dim sd As Range
Dim jahr As Integer
Dim y As Date
Dim hilf1 As Date
Dim x As Variant
'--------------------------------------------------
f = 2
z = 12
x = 1
std = 0
b = 9
For i = 2 To 147000
y = Sheets("Daten").Cells(i, 1).Value
hilf1 = Sheets("Daten").Cells(i + 1, 1).Value
If hilf1 = Empty Then
hilf = 999
Else
j = Month(y)
hilf = Month(hilf1)
jahr = Year(y)
End If
If j = hilf Then
x = x + 1
Else
Set sd = Range(Cells(i, 1), Cells(i, x))
Cells(i, 15).Value = Application.WorksheetFunction.StDev(sd)
sd = 0
x = 1
End If
Next i
End Sub
|