Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range, n%, c As Range
Application.EnableEvents = False
For Each r In [D9:AY18].Rows
n = 0
For Each c In r.Cells
If c.DisplayFormat.Interior.ColorIndex <> xlNone Then n = n + 1
Next c
r.Cells(1, r.Columns.Count + 2) = n / 4
Next r
Application.EnableEvents = True
End Sub