+ Reply to Thread
Results 1 to 4 of 4

Conditional Formatting By Rule

  1. #1
    Forum Contributor
    Join Date
    07-29-2009
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    255

    Conditional Formatting By Rule

    I have a cell I want to format. The cell is the sum of six cells.

    I have three types of formatting depending on the count of the six cells.

    1) Format type 1 if all six cells are populated

    2) Format type 2 if only five cells are populated

    3) No format if the count of cells is between 0 & 4.

    Hope this is clear..

    MQ
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.

  2. #2
    Registered User
    Join Date
    08-06-2013
    Location
    Quebec
    MS-Off Ver
    Excel 2013
    Posts
    31

    Re: Conditional Formatting By Rule

    To count nonblank cells, you can use the COUNTA function.

    Please Login or Register  to view this content.

  3. #3
    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,929

    Re: Conditional Formatting By Rule

    There is no need for VBA on this, regular Conditional Formatting will do the job. You did not specify the cells, so assume A1:A6...

    1. highlight the range you want to apply the conditional formatting to (A1:A6)
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =COUNTA($A1:$A6)=6................apply color (format fill) as required

    Repeat 3 & 4 with...
    =AND(COUNTA($A1:$A6)<6,COUNTA($A1:$A6)>4)

    Rinse and repeat with...
    =COUNTA($A1:$A6)<4
    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

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Conditional Formatting By Rule

    Hi pickslides,

    I always like to have a sample workbook to see how it all works, so here is your answer attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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. Top/Bottom Rule for Conditional formatting
    By thequebs in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-28-2014, 05:31 PM
  2. [SOLVED] Multiple Rule Conditional Formatting
    By jbenkov in forum Excel General
    Replies: 8
    Last Post: 11-30-2012, 12:21 PM
  3. Excel 2007 : Rule to supersede conditional formatting
    By dreinisch in forum Excel General
    Replies: 8
    Last Post: 09-01-2011, 02:16 PM
  4. Conditional formatting rule need help
    By Kagesen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-25-2011, 04:42 AM
  5. Replies: 1
    Last Post: 07-29-2010, 11:26 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