+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : Counting cells based on their colour

  1. #1
    Registered User
    Join Date
    10-29-2011
    Location
    South Glos
    MS-Off Ver
    Excel 2007
    Posts
    17

    Counting cells based on their colour

    Hi.

    In the attached workbook I am manually adding 1 for Green, 2 for Yellow and 3 for Red in column C, then COUNTIF to get totals. I would rather Excel recognise and count all cells with same colour i.e. all Green, all Yellow and all Red. Can excel count by colour? If so How is it done? Thanks.
    Attached Files Attached Files
    Last edited by fithawk; 10-31-2011 at 05:15 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Counting cells based on their colour

    Hi fithawk,
    How about a User Defined Function (UDF) to do your counting. See the code in the example and the way it works.
    Please Login or Register  to view this content.
    This will count the number of cells in B5 to B end that are the color of the active cell that the formula is in.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    10-29-2011
    Location
    South Glos
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Counting cells based on their colour

    Quote Originally Posted by MarvinP View Post
    Hi fithawk,
    How about a User Defined Function (UDF) to do your counting. See the code in the example and the way it works.
    Please Login or Register  to view this content.
    This will count the number of cells in B5 to B end that are the color of the active cell that the formula is in.
    No idea on macros, just a basic user. When I colour other rows the totals stay the same? Am I not doing something? Thanks

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Counting cells based on their colour

    Hi,
    You need to click in each of the colored cellls and put a space after the UDF and press enter. This will recalculate the count for each color.

    The real answer is counting colors is very hard in Excel. I like your hidden column C better than trying to work with colors.

    teylyn said it correctly when she said "colors aren't data"

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1