Function mycount(rng As Range)
'Example for Red =mycount(C10:AG10)
Dim c As Range, counter As Long
For Each c In rng
If c.Interior.Color = 255 Then counter = counter + 1
Next c
mycount = counter
End Function
Function mycount(rng As Range, mycolor As Range)
' Version 2 for all colors
' Example for Cell E16 =mycount($C10:$AG10,E$15)
Dim c As Range, counter As Long
For Each c In rng
If c.Interior.Color = mycolor.Interior.Color Then counter = counter + 1
Next c
mycount = counter
End Function