Hi all,
I have attached my workbook.
I am looking for at solution so count the blue cells per week. See attached image.
Right now I have used conditional formatting to color the cells, through this formula:
=AND(M$11>=$J13;M$11<=$K13)
Then in the green line, where I want to count the amount of colored cells in the week, i have used this code:
Function GetColorCount(CountRange As Range, CountColor As Range)
Dim CountColorValue As Integer
Dim TotalCount As Integer
CountColorValue = CountColor.Interior.ColorIndex
Set rCell = CountRange
For Each rCell In CountRange
If rCell.Interior.ColorIndex = CountColorValue Then
TotalCount = TotalCount + 1
End If
Next rCell
GetColorCount = TotalCount
End Function
Then added this formula to the cell:
=GetColorCount(M13:M200;$X$5)
But due to the cells being colored by conditional formatting this do not work.
Do you have any suggestions?
Thanks!2020-02-18_11-40-31.jpg
Bookmarks