+ Reply to Thread
Results 1 to 4 of 4

Conditional formatting under condition of min excluding blanks

  1. #1
    Registered User
    Join Date
    12-10-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2007
    Posts
    2

    Exclamation Conditional formatting under condition of min excluding blanks

    Hello all, hope that you can share your wise suggestion to my problem.
    In each row of row 4 to 7 in my attachment, I try to find out the cell in column B to G which is not blank and is the minimum among all non-blank cells not less than the input value (i.e. value in column A) and fill in color.
    For example, in row 4, C4 should be colored;
    in row 6, only B6 should be colored (and those blank cells in row 6 should NOT be colored).

    I tried different kinds of formulae in conditional formatting but none of them can work in all cases in the attachment (for example, after selecting range as B4:G7, I tried
    = $B4 = MIN(IF($B4:$G4>=$A4, IF(ISNUMBER($B4:$G4), $B4:$G4))) )

    Please help to find ways for such purpose.
    Using conditional formatting or VBA are both OK for me.

    PS: Attached is an excel file from Office 2000, and similar purpose has to be applied on another one from Office 2007. Please state any difference when deploying your suggestions to these two versions.
    Attached Files Attached Files
    Last edited by kip894; 12-12-2013 at 02:23 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: Conditional formatting under condition of min excluding blanks

    Please try this function in cond. formatting.
    =AND(MIN($B4:$G4)=B4,B4<>"")
    Please click 'Add reputation', if my answer helped you.

  3. #3
    Registered User
    Join Date
    12-10-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Conditional formatting under condition of min excluding blanks

    Quote Originally Posted by ramananhrm View Post
    Please try this function in cond. formatting.
    =AND(MIN($B4:$G4)=B4,B4<>"")
    Thank you for your suggestion.
    However in the minimum function, I have to consider only those non-empty cells which are not less than the input value in column A.
    Last edited by kip894; 12-12-2013 at 04:49 AM.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,849

    Re: Conditional formatting under condition of min excluding blanks

    Here is a solution that uses a VBA user-defined function. The other way I was able to find requires an array formula, which can't be used in a conditional formatting formula. Another way to do it is to use a "helper" column using that array formula. The posted solution requires no helper column.

    There is one column that shows how the function works but it is not required for the solution, it's just a demo.

    The function works in 2003 forward. I composed the conditional formatting in 2010, which is the same as 2007, and should also port to 2003 (which I don't have, so I can't test it).
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Formula for Conditional Formatting Bottom 5 excluding 0's
    By FlyinIron406 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-10-2013, 02:23 AM
  2. Conditional Formatting skipping blanks
    By hanjimono in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-13-2013, 12:08 AM
  3. Help with excluding blank cells or with conditional formatting
    By macky18 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-07-2012, 10:22 AM
  4. Replies: 6
    Last Post: 02-25-2012, 12:15 AM
  5. Excluding Blank Cells in Conditional Formatting
    By cakonopka in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-16-2007, 04:08 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