If the cells are manually colored and you want a count in a cell as a result
of a formula you will have to go the VBA function route.
If you just want to see a count of the blue colored cells go to Edit>Find
Find>Format>Format>Pattern>Blue
Find All
With the list of "founds" in the dialog box hit CTRL + a to select all.
Now right-click on Status bar and select "Count"
For the VBA..................copy this function to a general module in your
workbook.
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
If you're not familiar with VBA and macros, see David McRitchie's site for
more on "getting started".
http://www.mvps.org/dmcritchie/excel/getstarted.htm
or Ron de De Bruin's site on where to store macros.
http://www.rondebruin.nl/code.htm
In the meantime..........
First...create a backup copy of your original workbook.
To create a General Module, hit ALT + F11 to open the Visual Basic Editor.
Hit CRTL + r to open Project Explorer.
Find your workbook/project and select it.
Right-click and Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.
In a cell enter this formula =CountByColor(A1:A100,3,False)
This will count all red colored cells in the range A`1:A100
Use the number 5 to count blue cells
Gord Dibben MS Excel MVP