Hi
Hope someone can help.
I need a formula to count the number of times a number appears in a background filled cell, ignoring the occasions when it appears in cells with no background fill.
Say the number is to be entered in cell T3, and the range to examine is L6:EM179, and the cell Colour Index is 37 (Dark Blue in Excel 2010), I’ve tried the following array formula:
{=COUNT(IF(GetColor(L6:EM179)=37,IF(L6:EM179=T3,1,””),””))}
Where GetColor is set up as a VBA User Defined Function using the following code cribbed off the Internet:
Function GetColor(Mycell As Range)
GetColor = Mycell.Interior.ColorIndex
End Function
Unfortunately, this doesn’t appear to work, as it just returns a zero result.
Any help would be greatly appreciated.
Thanks
Bookmarks