Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
By white you mean the background color white or "no background color"? –  nixda Jan 26 '13 at 21:55
1  
did you take a look at this? superuser.com/q/328326/14596 –  datatoo Jan 26 '13 at 22:01

1 Answer 1

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
    Next
    MsgBox "Yellow: " & yellow & Chr(13) _
         & "Red: " & red & Chr(13) _
         & "White: " & white & Chr(13) _
         & "Others: " & others
    End Sub
    
share|improve this answer

Your Answer

 
discard

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.