title: Excel Countifs formula with one color criteria and the rest normal
body: <p>How do I get an excel 2010 formula that can do countifs criteria that includes color? I saw this: <a href="https://support.microsoft.com/en-us/kb/2815384" rel="nofollow">https://support.microsoft.com/en-us/kb/2815384</a>  but it only gives me the count of cells with that color. I need an additional criteria to be available in the formula or I need the VBA that is provided in the link there to only work on visible cells (using filters on my data). Any ideas? I appreciate the help.</p>
  
  <p>Here is the code provided by the link:</p>
  
  <pre><code>Function CountCcolor(range_data As range, criteria As range) As Long
      Dim datax As range
      Dim xcolor As Long
  xcolor = criteria.Interior.ColorIndex
  For Each datax In range_data
      If datax.Interior.ColorIndex = xcolor Then
          CountCcolor = CountCcolor + 1
      End If
  Next datax
  End Function
  </code></pre>