When we have colors on our sheets data and want, for instance, to count how many “red” words we have on our sheet, that is not possible because there is no formula in Excel to check for font colors. Instead we can create our own VBA Function to get the font color. It’s a very simple code. You have to insert it on a VBA module on your sheet.
Function GetFontColor(ByVal Target As Range) As Object
GetFontColor = Target.Font.ColorIndex
Then you can use it on your sheet like this:
Below is an example on how you can use this function. In column C we put the font color of text in column A.
“3” in the formula refers to the color red.