I've tried twice to ask for help on this query on the programming section as it now appears to be a programming query but for some unexplained reason the thread keeps being deleted!... I shall try again here!...

I only have limited VBA experience so I don't know how to expand on the COUNTBYCOLOR function as suggested with the conditional values. This is the code I have been using which I have obtained from another website:

Function CountByColor(InRange As Range, _
WhatColorIndex As Integer, _
Optional OfText As Boolean = False) As Long

Dim Rng As Range
Application.Volatile True

For Each Rng In InRange.Cells
If OfText = True Then
CountByColor = CountByColor - _
(Rng.Font.ColorIndex = WhatColorIndex)
Else
CountByColor = CountByColor - _
(Rng.Interior.ColorIndex = WhatColorIndex)
End If
Next Rng

End Function

I still want to be able to call the function through a formula into any cell. I
would really appreciate any help on this.