Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to count the yellow, red and white (no color) cells in a column (range) within a Microsoft Excell sheet. The colors are equal (i.e. only one RGB value of yellow is used, not light/dark yellow etc).

Is this possible?

share|improve this question
By white you mean the background color white or "no background color"? – nixda Jan 26 '13 at 21:55
did you take a look at this? – datatoo Jan 26 '13 at 22:01
up vote 1 down vote accepted

I doubt there is a way with normal Excel functions.
But here is a quick solution using VBA.

  • open your workbook and press ALT+F11
  • insert the code below into sheet1 or where ever your data is
  • customize the Range("A1:A100") to whatever you need
  • close the VBA editor and go back to the sheet with your data
  • press ALT+F8 and execute the macro

    Sub countcolor()
    For Each cell In Range("A1:A100")
        Select Case cell.Interior.ColorIndex
        Case 6: yellow = yellow + 1
        Case 3: red = red + 1
        Case 2: white = white + 1
        Case Else: others = others + 1
        End Select
    MsgBox "Yellow: " & yellow & Chr(13) _
         & "Red: " & red & Chr(13) _
         & "White: " & white & Chr(13) _
         & "Others: " & others
    End Sub
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.