I fully agree with @teylyn's warning, but if there are some very justified reasons for such a solution, you can use such a function, for example.
Function ColorCount(rng As Range, pat) As Long
Dim cell As Range, cnt As Long
Select Case TypeName(pat)
Case "Range": pat = pat.Interior.Color
Case "String": pat = Range(pat).Interior.Color
End Select
For Each cell In rng
If cell.Address = cell.MergeArea(1).Address And _
cell.Interior.Color = pat Then
cnt = cnt + 1
End If
Next cell
ColorCount = cnt
End Function
The function takes two arguments: the first is the range of cells to check, the second is the color pattern (this can be a reference, address text, or a numeric color value). The color of the cell from base formatting, not conditional.