+ Reply to Thread
Results 1 to 9 of 9

How to count colored cells with conditional formatting

  1. #1
    Registered User
    Join Date
    08-08-2016
    Location
    Columbus, OH
    MS-Off Ver
    2010
    Posts
    7

    How to count colored cells with conditional formatting

    Hi...I'm using excel 2010 and have data that is conditionally formatted to change color based on the entered data. I want to be able to count the # of colored cells automatically and have that value populate in the cell I want it to.

    Thank you for your time into this!

  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 to count colored cells with conditional formatting

    What is the rule that applies the CF?

    You should be able to write a formula using the logic of the CF rule to get the count.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    08-08-2016
    Location
    Columbus, OH
    MS-Off Ver
    2010
    Posts
    7

    Re: How to count colored cells with conditional formatting

    Here are the two conditions...first one is colored green and the second one is colored red

    =AND(A2>=(A1-"0:10"),A2<=(A1+"0:05"))

    =OR(A2<(A1-"0:10"),A2>(A1+"0:05"))

  4. #4
    Registered User
    Join Date
    02-15-2016
    Location
    United States
    MS-Off Ver
    2010
    Posts
    33

    Re: How to count colored cells with conditional formatting

    Hello DJFISH614,

    The information in this article (steps 1-7) will help you quickly accomplish your goal :

    https://support.microsoft.com/en-us/kb/2815384

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

    Re: How to count colored cells with conditional formatting

    Quote Originally Posted by DJFISH614 View Post
    Here are the two conditions...first one is colored green and the second one is colored red

    =AND(A2>=(A1-"0:10"),A2<=(A1+"0:05"))

    =OR(A2<(A1-"0:10"),A2>(A1+"0:05"))
    OK, you'll have to put those in context.

    What's in A2?
    What's in A1?

    What cell is the formatting applied to? What cells do you want to count?

  6. #6
    Registered User
    Join Date
    08-08-2016
    Location
    Columbus, OH
    MS-Off Ver
    2010
    Posts
    7

    Re: How to count colored cells with conditional formatting

    In this instance it's time. A1 is the Scheduled time and A2 is the actual time...This is actually being changed to A1 and B1 to read side by side. Where the B Column (actual) has the conditions set on it. below the data is where I want the count to go.

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

    Re: How to count colored cells with conditional formatting

    I think we're going to need to see a sample file.

    Can you post a SMALL sample file and show us what result you expect?

    A SMALL file will have about 20 rows worth of data.

  8. #8
    Registered User
    Join Date
    08-08-2016
    Location
    Columbus, OH
    MS-Off Ver
    2010
    Posts
    7

    Re: How to count colored cells with conditional formatting

    I think I uploaded the attachment correctly.
    Attached Files Attached Files

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

    Re: How to count colored cells with conditional formatting

    I think this does what you want...

    Data Range
    B
    C
    D
    E
    1
    Employee
    2
    IHIS Time
    Actual
    Notes
    3
    Monday
    9:00
    9:11
    4
    Tuesday
    7:00
    7:04
    5
    Wednesday
    8:00
    8:00
    6
    Thursday
    6:00
    5:55
    7
    Friday
    7:00
    7:45
    8
    3
    9
    2


    This formula entered in D8:

    =SUMPRODUCT(--(D3:D7>=C3:C7-TIME(0,10,0)),--(D3:D7<=C3:C7+TIME(0,5,0)))

    This formula entered in D9:

    =COUNT(D3:D7)-D8

+ 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. Replies: 6
    Last Post: 06-07-2016, 01:50 AM
  2. Adding value of colored cells (conditional formatting)
    By Crawfy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-30-2016, 07:19 AM
  3. [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
  4. Replies: 1
    Last Post: 11-09-2013, 02:43 AM
  5. Count Cells colored by conditional formatting
    By sam99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2013, 02:58 PM
  6. 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
  7. conditional formatting and colored cells
    By henro8 in forum Excel General
    Replies: 9
    Last Post: 07-10-2008, 03:12 PM

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