Using Excel 2007, I am creating a sheet that will track upcoming due dates by 30, 60, and 90 days out. The data in the cells will be dates. I have used the conditional formatting commands for the cells as such: 30 days or less: block background is red. 60 days out: block is yellow. 90 days out: block is green. Over 90 days: block is purple. I have added a colorcount module using alt+F11 already. I then used the associated formula to count based on the colors needed, shading corresponding blocks below my working sheet to use as references. Below are the formulas I used:

Function ColorFunction(rColor As Range, rRange As Range, Optional SUM As Boolean)
Dim rCell As Range
Dim lCol As Long
Dim vResult
lCol = rColor.Interior.ColorIndex
If SUM = True Then
For Each rCell In rRange
If rCell.Interior.ColorIndex = lCol Then
vResult = WorksheetFunction.SUM(rCell, vResult)
End If
Next rCell
Else
For Each rCell In rRange
If rCell.Interior.ColorIndex = lCol Then
vResult = 1 + vResult
End If
Next rCell
End If
ColorFunction = vResult
End Function

Formula: =colorfunction(A,B:C,FALSE) not doing a sum, just counting the colored blocks.

Anyway, I do not get any error messages, but the equation isn't working either. I tried checking the auto calculate feature, saved my empty sheet as a macro, and used ctrl+alt+f9 with no luck. Can anyone help with this?