+ Reply to Thread
Results 1 to 7 of 7

Formula or a VBA code to count the cells which are colored by Conditional Formatting

  1. #1
    Forum Contributor
    Join Date
    12-15-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    202

    Formula or a VBA code to count the cells which are colored by Conditional Formatting

    Hello everyone,

    I have an excel sheet where I have formatted Cell M1:M1000 as conditional formatting with color codes based on the other values in the sheet.
    I have 2 colors - Orange and Green.
    Now I need to count the number of Orange and Green colored cells in M1:M1000.
    Is there any way to achieve this?

    Thanks in advance.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Formula or a VBA code to count the cells which are colored by Conditional Formatting

    You cannot count formatting like that, but what you may be able to do, is use teh same rule that you used for the CF - for the count
    What rule did you use?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    12-15-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Formula or a VBA code to count the cells which are colored by Conditional Formatting

    Hello Admin,

    Thank you for replying to my post. These are conditions in formatting.

    Please Login or Register  to view this content.
    It colors Orange
    Please Login or Register  to view this content.
    It colors Green

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Formula or a VBA code to count the cells which are colored by Conditional Formatting

    OK so try this...
    =countifs($M$1:$M$1000,"<"&$L4-1)

  5. #5
    Forum Contributor
    Join Date
    12-15-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Formula or a VBA code to count the cells which are colored by Conditional Formatting

    This formula is not working as expected.
    Not getting the exact result.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Formula or a VBA code to count the cells which are colored by Conditional Formatting

    upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

  7. #7
    Forum Contributor
    Join Date
    12-15-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Formula or a VBA code to count the cells which are colored by Conditional Formatting

    File attached for reference.

    The file attachment service is bit confusing.
    So here is the download link
    https://we.tl/kPQ0eSH0Gi

    If K is greater than J then it is colored in Green
    If J is greater than K then it is colored in Orange.

    I want to count both the Green and Orange cells.
    Attached Files Attached Files

+ 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. Adding value of colored cells (conditional formatting)
    By Crawfy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-30-2016, 07:19 AM
  2. [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
  3. Need VBA code to count cells with conditional formatting
    By benlindell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2014, 07:45 PM
  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