+ Reply to Thread
Results 1 to 5 of 5

How can I count coloured cells (coloured using Conditional Formatting)

  1. #1
    Registered User
    Join Date
    10-15-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    How can I count coloured cells (coloured using Conditional Formatting)

    Hello

    I used Conditional Formatting to highlight cells containing specific values (i.e. less than, between, etc...). I now need to show a count of how many cells are green, red, yellow, etc...

    I have been reading about having to create a User Defined Function using VBA, but after various tests, I can only achieve the desired results if I manually highlighted the cells (i.e. highlighted the cell and filled it with colour).

    How can I count the cells which were highlighted using Conditional Formatting?

    I am using Excel 2007.

    Thanks,
    Steph

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How can I count coloured cells (coloured using Conditional Formatting)

    If the cells are using conditional formatting then you should be able to write formulas based on the CF rule(s) being applied.

    Tell us what those CF rules are and we can help you write the formulas.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: How can I count coloured cells (coloured using Conditional Formatting)

    You need to set up a similar formula as those you have used for conditional formatting. For example, if one of your conditions is to turn the cell green if it is less than 10, then to count the green cells you would need a formula like this:

    =COUNTIF(cell_range,"<10")

    Set up similar formulae for the other conditions - you may need to use COUNTIFS if you have more than one condition to trigger the colour (like between two values).

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    10-15-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: How can I count coloured cells (coloured using Conditional Formatting)

    The CF rules are as follows:

    equal to and less than 59.9% = red
    between 60.0% and 69.9% = yellow
    equal to and greater than 70.0% = green

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: How can I count coloured cells (coloured using Conditional Formatting)

    To count red:

    =COUNTIF(cell_range,"<0.6")

    To count green:

    =COUNTIF(cell_range,">=0.7")

    To count yellow:

    =COUNTIFS(cell_range,">=0.6",cell_range,"<0.7")

    Change cell_range as appropriate.

    Hope this helps.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Adding only cells coloured using conditional formatting
    By FranAgrippina in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2013, 08:49 AM
  2. Count Coloured cells (conditional formatting)
    By MaddieRoberts in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-19-2012, 08:46 AM
  3. Counting coloured cells based on conditional formatting
    By sponge_designs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-06-2011, 02:20 PM
  4. Excel 2007 : Conditional formatting & Coloured data bars
    By alex Kurtz in forum Excel General
    Replies: 7
    Last Post: 01-29-2009, 06:20 AM
  5. Count coloured Cells
    By shree in forum Excel General
    Replies: 2
    Last Post: 08-24-2006, 01:57 AM

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