Function ColorFunction(rRange As Range)
Dim rCell As Range, vResult
Application.Volatile
For Each rCell In rRange
If rCell.Interior.ColorIndex = 6 And rCell.Value = "satisfactory" Then vResult = 1 + vResult
Next rCell
ColorFunction = vResult
End Function
Book1 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | |||||
2 | |||||
3 | |||||
4 | |||||
5 | 3 | ||||
6 | satisfactory | ||||
7 | |||||
8 | |||||
9 | |||||
10 | |||||
11 | |||||
12 | satisfactory | ||||
13 | satisfactory | ||||
14 | satisfactory | ||||
15 | |||||
16 | |||||
17 | |||||
18 | |||||
Sheet4 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C5 | =ColorFunction(A1:A17) |