+ Reply to Thread
Results 1 to 6 of 6

Sum/ Count colored cells based on conditional formatting

  1. #1
    Registered User
    Join Date
    01-22-2015
    Location
    England
    MS-Off Ver
    Microsoft Office 365
    Posts
    92

    Sum/ Count colored cells based on conditional formatting

    Hi all

    So I have a spreadsheet in which cells in the Value column(B) are formatted to red when the value is below target (column C) and then formatted green when the value has met or exceeded target. I need to show what percentage of targets have been met.

    So for example in my attached document , there are 2 cells out of three that are in red. If I could count the red cells and the green cells , i would be able to calculate a percentage. If anyone can please help with a formula for this, I'd be really happy!

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Sum/ Count colored cells based on conditional formatting

    This will give you the percentage of targets that have been hit (i.e. percentage of total cells in column B that are green):

    =SUMPRODUCT(--(B2:B4>=C2:C4))/COUNT(B2:B4)

  3. #3
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Sum/ Count colored cells based on conditional formatting

    For green:

    =SUMPRODUCT(--(B2:B4>=C2:C4))

    For Red:

    =SUMPRODUCT(--(B2:B4<C2:C4))

  4. #4
    Registered User
    Join Date
    01-22-2015
    Location
    England
    MS-Off Ver
    Microsoft Office 365
    Posts
    92

    Re: Sum/ Count colored cells based on conditional formatting

    Thank you, great!!

    How can I amend the formula so that it excludes any targets in column C that are N/A, therefore the value in column B will not be formatted to either red or green. See below for an example

    Value Target
    Referrals 5 10
    Appraisals 7 4
    Complaints
    handled 93% 100%
    Accepted 5 N/A

  5. #5
    Registered User
    Join Date
    01-22-2015
    Location
    England
    MS-Off Ver
    Microsoft Office 365
    Posts
    92

    Re: Sum/ Count colored cells based on conditional formatting

    Just bumping this up. Any help would be greatly appreciated !

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Sum/ Count colored cells based on conditional formatting

    Perhaps
    =SUMPRODUCT((B2:B4>=C2:C4)*(C2:C4<>"N/A"))/COUNTIF(C2:C4,"<>N/A")
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ 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. How do I Count Cells Colored with Conditional Formatting?
    By PixelPug in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2017, 04:28 AM
  2. How to count colored cells with conditional formatting
    By DJFISH614 in forum Excel General
    Replies: 8
    Last Post: 08-09-2016, 06:06 PM
  3. Replies: 6
    Last Post: 06-07-2016, 01:50 AM
  4. [SOLVED] Count colored cells for conditional formatting
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-08-2015, 05:52 AM
  5. Replies: 1
    Last Post: 11-09-2013, 02:43 AM
  6. Count Cells colored by conditional formatting
    By sam99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2013, 02:58 PM
  7. How to count colored cells with conditional formats
    By lowrey72 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2009, 02:51 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