I found function instructions to count cells with red fonts and it works fine. (My Thanks to Mike) However, the next step for me is to count the red font cells that are less than the value of 20. I've tried to combine the instructions with both IF and And formulas and both have failed miserably.
The working function is:
Function CountColour(rng As Range, clr As Range)
Application.Volatile
Dim c As Range
For Each c In rng
If c.Font.Color = clr.Font.Color Then
CountColour = CountColour + 1
End If
Next
End Function
The working formula is: (the range of cells is S32:Y45 and the cell color to count is V48)
=CountColour(S32:Y45,V48)
My attempts included several variations of:
=AND(S32:Y45<20, CountColour(S32:Y45,V48))
=IF(S32:Y45<20, CountColour(S32:Y45,V48), "")
Would anyone know how to adjust the function or formula so that I can count the red cells that are less than 20?
The working function is:
Function CountColour(rng As Range, clr As Range)
Application.Volatile
Dim c As Range
For Each c In rng
If c.Font.Color = clr.Font.Color Then
CountColour = CountColour + 1
End If
Next
End Function
The working formula is: (the range of cells is S32:Y45 and the cell color to count is V48)
=CountColour(S32:Y45,V48)
My attempts included several variations of:
=AND(S32:Y45<20, CountColour(S32:Y45,V48))
=IF(S32:Y45<20, CountColour(S32:Y45,V48), "")
Would anyone know how to adjust the function or formula so that I can count the red cells that are less than 20?