0

enter image description here

I would like to know how many blue A are under SONY and how many pink A are under Sony as well . The same situation for Wii

I'm having issues combining INDEX+ COUNTIF because i do not know how include the fontcolor on the formula

Community
  • 1
  • 1
Karl D
  • 63
  • 2
  • 2
  • 11
  • 1
    This can't be done with a standard formula, you need a UDF. How proficient are you at VBA? You will need to pass in a count range (B:C) and 2 reference cells, one will have the type (E3 or E4) and the other would have the coloured cell (F2 or G2). Scan the columns first to get a single column with the console then scan down that column summing the occurrences of the coloured letter as you go. – Dan Donoghue Apr 21 '15 at 05:00
  • [this answer](http://stackoverflow.com/a/15888583/4002530) to similar question may be of use too. – tospig Apr 21 '15 at 05:02

1 Answers1

0

Using the Font.Color property in Excel VBA, you can loop through the cells in a range and check if they match a color property.

Here's an example to get you started. It checks cells in the first four rows in the first column, and sees if they are colored RGB(255, 0, 0), which is red:

For i = 1 To 4
    If Cells(i, 1).Font.Color = RGB(255, 0, 0) Then
        'code to execute here if the cell has
        'font with red coloring
    End If
Next
Aaron Thomas
  • 5,054
  • 8
  • 43
  • 89