Function ColourCount(cel As Range, ran As Range) As Long
Dim colo&, cou&, c As Range
Application.Volatile
colo = cel.Interior.ColorIndex
For Each c In ran
If ran.Parent.Evaluate("DColorIndex(" & c.Address & ")") = colo Then
cou = cou + 1
End If
Next c
ColourCount = cou
End Function