+ Reply to Thread
Results 1 to 5 of 5

Function: Count conditional formatting colors using formula IF(AND

  1. #1
    Registered User
    Join Date
    02-19-2018
    Location
    Czech Republic
    MS-Off Ver
    Excel 2016
    Posts
    61

    Question Function: Count conditional formatting colors using formula IF(AND

    Hi all,

    I have found how to count conditional formatting colors when the conditional format is set with a simple formula like =A3>50 or A3=37... but when I change the formula to the classic IF(AND to change the color when the values are not within specific values, then it doesn't work. Even if I change the simple formula adding decimals for example =A3>50,46 it won't work either. See the attached example please.

    Is there a way to make the function count properly the colors from conditional formatting by using the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    as it is in the attached example with green color?

    Thank you all in advance for your help!
    Attached Files Attached Files
    Last edited by thorblow; 06-17-2021 at 06:04 PM.

  2. #2
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,416

    Re: Function: Count conditional formatting colors using formula IF(AND

    EXCEL seems to have no way to judge the color generated by conditional formatting, it must be done with a formula

    Cell J2 array formula
    HTML Code: 
    Cell J3 array formula
    HTML Code: 

  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,726

    Re: Function: Count conditional formatting colors using formula IF(AND

    You can use this array* formula in I3, based on your CF condition for green:

    =SUM(IF(($A$3:$G$16>=$M$1)*($A$3:$G$16<=$M$2),0,1))

    *Note that an array formula needs to be confirmed using the key combination of Ctrl-Shift-Enter, instead of the usual Enter.

    It gives a result of 66.

    Hope this helps.

    Pete

    EDIT: You may need to use semicolons ( ; ) instead of commas ( , ), depending on your regional settings.

  4. #4
    Registered User
    Join Date
    02-19-2018
    Location
    Czech Republic
    MS-Off Ver
    Excel 2016
    Posts
    61

    Re: Function: Count conditional formatting colors using formula IF(AND

    Wow! I didn't know that existed such a thing!! Why the array formula needs to be confirmed differently than the usual enter? Just wondering if there is a rational answer :D

    Anyway, thanks a lot for the help! With the ctrl+shift+enter works perfect!

  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,416

    Re: Function: Count conditional formatting colors using formula IF(AND

    You're Welcome. Thank You for the feedback

+ 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] conditional formatting for multiple columns and count cells based on colors
    By anita2017 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-19-2020, 05:09 PM
  2. [SOLVED] Conditional Formatting to fill Colors using formula
    By dlealb in forum Excel General
    Replies: 3
    Last Post: 08-19-2020, 01:47 PM
  3. Conditional Formatting Formula By Using Colors In the Cells
    By shameen294433 in forum Excel General
    Replies: 11
    Last Post: 02-09-2017, 10:21 AM
  4. Replies: 11
    Last Post: 10-22-2013, 11:31 AM
  5. [SOLVED] Formula based off cell colors / conditional formatting?
    By dsciola in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-30-2013, 03:48 AM
  6. [SOLVED] Conditional Formatting Colors
    By FoxRacing1234 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-25-2013, 10:07 AM
  7. Count colors with conditional formatting
    By vinaysalian17 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2007, 02:50 AM

Tags for this Thread

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