AW: Gemischter Mittelwert
welga
Hallo,
wenn es möglich eine Hilfsspalte einzufügen dann probier das mal:
Sub berechnen()
Dim i As Long
Dim mit() As Variant
Dim a As Long
a = 0
With ThisWorkbook.Sheets(1)
For i = 1 To 100
If .Cells(i, 1).Value = "" Then GoTo rechnen
.Cells(i, 3).Value = .Cells(i, 2).Value / .Cells(i, 1).Value
a = a + 1
Next i
rechnen:
.Cells(1, 4).Value = 0
For i = 1 To a
.Cells(1, 4).Value = .Cells(i, 3).Value + .Cells(1, 4).Value
Next i
.Cells(1, 4).Value = .Cells(1, 4).Value / a 'Gemischter Mittelwert
End With
End Sub
Gruß
welga