View Single Post
  #2   Report Post  
Mangesh Yadav
 
Posts: n/a
Default

Use the following UDF


Function CountColor(rng As Range, colorRng As Range)

For Each cl In rng
If cl.Interior.ColorIndex = colorRng.Interior.ColorIndex Then ' use
this for background color
CountColor = CountColor + 1
End If
Next

End Function


Usage
=countcolor(A1:A10,A1)

A1:A10 is the range for which you want to count, and A1 is the cell which
has the desired color format which you want as criteria


Mangesh



"amvena" wrote in message
...
I have a list of percentages that are conditionally formatted and I want

to
be able to count how many cells are each different colour. I don't think

you
can do this with count if as it only looks for numbers or text and not
formatting but essentially I want to count the number of cells in a range
which are red/gold or green.