Well then it makes perfect sense to use VBA.
You didn't provide much details, so this is what the code below does:
- Check each cell in column A starting in A1 untill the last cell used.
- The cells will be colored according to your 4 conditions. The colors will be respectively Red, Yellow, Green and Blue.
- The result of the counted colors will be put in the range C1:C4, of which the cells are colored as well for easy reference.
Here is the code:
Dim cRed, cYellow, cGreen, cBlue As Integer
For Each cell In Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
If cell.Value < 24 And cell.Value Mod 2 = 1 Then
cell.Interior.Color = vbRed
cRed = cRed + 1
If cell.Value > 24 And cell.Value Mod 2 = 1 Then
cell.Interior.Color = vbYellow
cYellow = cYellow + 1
If cell.Value < 23 And cell.Value Mod 2 = 0 Then
cell.Interior.Color = vbGreen
cGreen = cGreen + 1
If cell.Value > 23 And cell.Value Mod 2 = 0 Then
cell.Interior.Color = vbBlue
cBlue = cBlue + 1
Range("C1").Value = cRed
Range("C1").Interior.Color = vbRed
Range("C2").Value = cYellow
Range("C2").Interior.Color = vbYellow
Range("C3").Value = cGreen
Range("C3").Interior.Color = vbGreen
Range("C4").Value = cBlue
Range("C4").Interior.Color = vbBlue
Let us know if alterations are desired.