+ Reply to Thread
Results 1 to 15 of 15

Conditional Formatting

  1. #1
    Registered User
    Join Date
    09-22-2009
    Location
    Sydney,Australia
    MS-Off Ver
    MS Office 365
    Posts
    39

    Conditional Formatting

    Hi,

    Is there a formula that will count the number of colored cells that formatted by Conditional Formatting.

    I would like to know the number of Green and Red cells that have been highlighted by CF.


    Thanks.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Conditional Formatting

    Try using the CF formulas in a couple of COUNTIF formulas.
    Ben Van Johnson

  3. #3
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Conditional Formatting

    Broadly speaking, no, there are not any functions that do that. Functions look at what is "inside" the cell, and formatting is applied "on top" of them.

    Instead what you're better off doing is just running a COUNTIF on the range of formatted cells with the same criteria you used to apply the CF in the first place.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  4. #4
    Registered User
    Join Date
    09-22-2009
    Location
    Sydney,Australia
    MS-Off Ver
    MS Office 365
    Posts
    39

    Re: Conditional Formatting

    Thanks.

    What would the formula be as my skills formulas are basic.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Conditional Formatting

    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced next to Quick Post button at the bottom right of the editor box.
    • Scroll down until you see "Manage Attachments",
    • Click the "Choose" button at the upper left (upload from your computer).
    • Select your file, click "open", click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Close the Attachment Manager window.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!

  6. #6
    Registered User
    Join Date
    09-22-2009
    Location
    Sydney,Australia
    MS-Off Ver
    MS Office 365
    Posts
    39

    Re: Conditional Formatting

    Sorry attached sample workbook

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Conditional Formatting

    Please try the attachment again.

  8. #8
    Registered User
    Join Date
    09-22-2009
    Location
    Sydney,Australia
    MS-Off Ver
    MS Office 365
    Posts
    39

    Re: Conditional Formatting

    What about now?
    Attached Files Attached Files

  9. #9
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Conditional Formatting

    It looks like your CF is kind of a mess, but aren't you just highlighting the lowest & highest values in each row?

    In which case, wouldn't the number of green/red cells each be simply be the number of rows you have filled in, with possibly some error handling for rows with one entry?

  10. #10
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Conditional Formatting

    Named ranges used:
    MaxAndMins =Test!$K$3:$L$35
    MaxVals =Test!$K$3:$K$35
    MinVals =Test!$L$3:$L$35
    supplier_1 =Test!$D$3:$D$35
    supplier_2 =Test!$E$3:$E$35
    supplier_3 =Test!$F$3:$F$35
    supplier_4 =Test!$G$3:$G$35
    supplier_5 =Test!$H$3:$H$35

    Each row of the sample data has a max and a min value. Use two helper columns to extract the max and mins for each row, then use
    Please Login or Register  to view this content.
    M4:V4 supplier names referring to ranges
    ISEVEN(COLUMN())+1) calculates the column of the max/min table/array to use


    Modify, reduce your conditional format formulas (choose four colors)
    highlight min/max for each column:

    =D3=MIN(INDEX($D$3:$H$35,,COLUMN(A1)))
    =D3=MAX(INDEX($D$3:$H$35,,COLUMN(A1)))

    highlight min/max for each ROW:
    =D3=MIN(INDEX($D$3:$H$35,ROW(A1),))
    =D3=MAX(INDEX($D$3:$H$35,ROW(A1),))
    Attached Files Attached Files
    Last edited by protonLeah; 03-25-2018 at 02:43 PM.

  11. #11
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Conditional Formatting


  12. #12
    Registered User
    Join Date
    09-22-2009
    Location
    Sydney,Australia
    MS-Off Ver
    MS Office 365
    Posts
    39

    Re: Conditional Formatting

    Thanks All.

  13. #13
    Registered User
    Join Date
    09-22-2009
    Location
    Sydney,Australia
    MS-Off Ver
    MS Office 365
    Posts
    39

    Re: Conditional Formatting

    Hi @protonLeah,

    Thanks for your help.

    I tried the above but it doesn't work as some of the cells are grouped together and also the information needed is from different columns. I have attached the sheet that I am working on.
    Attached Files Attached Files

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Conditional Formatting

    Perhaps the following will be of some help.
    Populate AJ42:DA42 using: =COUNTIFS(AJ3:AJ35,MIN(AJ3:AJ35))
    Get a sum of the values in AJ42:DA42 that a visible using: =SUMIFS(AJ42:DA42,AJ2:DA2,"Calc Annual Value*")
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  15. #15
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Conditional Formatting

    Two column Named ranges for annual calcs for each supplier:
    Supplier_A ='Pricing Results Analysis'!$V$3:$W$36
    Supplier_B ='Pricing Results Analysis'!$AJ$3:$AK$36
    Supplier_C ='Pricing Results Analysis'!$AX$3:$AY$36
    Supplier_D ='Pricing Results Analysis'!$BL$3:$BM$36
    Supplier_E ='Pricing Results Analysis'!$BZ$3:$CA$36
    Supplier_F ='Pricing Results Analysis'!$CN$3:$CO$36
    Supplier_G ='Pricing Results Analysis'!$DA$3:$DB$36

    Two column named range for extracted max/mins:
    MaxAndMins ='Pricing Results Analysis'!$DD$3:$DE$36

    There are two summary tables: "Multiple Locations" and "Single Locations".

    Counts are tallied with:
    Please Login or Register  to view this content.
    INDEX(INDIRECT(DG$3) points to the supplier's named range
    MATCH($DG$2,{"multiple","single"},0) determines which column, Multi or single

    * Unfortunately, I was not able to test very well due to so many formulas that referred to to empty cells. There are several cells with formulas different from the other formulas in the same column and several circular ref errors.
    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. [SOLVED] Override conditional formatting (in general, without changing the conditional formatting)
    By Stormin' in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2017, 07:15 AM
  2. Replies: 1
    Last Post: 12-08-2016, 03:14 PM
  3. Conditional Formatting Removing Previous Conditional Formatting?
    By CravingGod in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2016, 01:02 PM
  4. Replies: 6
    Last Post: 01-08-2016, 06:44 PM
  5. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  6. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  7. Replies: 3
    Last Post: 05-15-2012, 04:13 PM

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