+ Reply to Thread
Results 1 to 6 of 6

Conditional format for Max value

  1. #1
    Registered User
    Join Date
    08-27-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    76

    Conditional format for Max value

    I know this should be easy. I want to highlight the highest value in a column of numbers, but when I use the obvious [=MAX(D:D)] in a conditional format formula, it highlights the entire column. What am I doing wrong?

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Conditional format for Max value

    Hi,

    Amend it to e.g.:

    =D1=MAX($D:$D)

    assuming D1 is the first in your range.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    08-27-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Conditional format for Max value

    Thanks, XOR! That fixed it.

    Can you explain the logic of your formula to me? I'm trying to see how I could apply that to other problems, and it's escaping me.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Conditional format for Max value

    Sure.

    Basically, and particularly if using a formula-based approach, CF will apply to those cases where a Boolean TRUE is returned.

    Let's say for example that the maximum value in column D is 1000.

    In your original construction, =MAX(D:D) evaluates to =1000 (for all cells), but this is not sufficient for Excel since, even when it applies it to the actual cell in that range which contains this maximum value, it has not returned a TRUE/FALSE value, which it needs.

    Whereas in my construction, =D1=MAX($D:$D), when applied to all the cells in the range, will produce a series of tests:

    =D1=MAX($D:$D)
    =D2=MAX($D:$D)
    =D3=MAX($D:$D)

    etc., all of which, when evaluated, will produce results such as (taking some random numbers in those cells):

    =33=1000
    =1000=1000
    =249=1000

    etc., which, in turn, evaluate to:

    FALSE
    TRUE
    FALSE

    The important thing to remember is to make sure that the formula you are using for which you wish to have the Conditional Formatting applied is one which evaluates to either TRUE or FALSE.

    Also, I notice that you had not fixed your range reference (D:D, not $D:$D). Although you are using a whole column as the range here, in general you need to consider the potentially negative consequences of not fixing the range - although you don't 'see' the Conditional Formatting formulas, when entered with relative references they behave just as worksheet formulas would when copied down.

    Hope that helps.

    Regards

  5. #5
    Registered User
    Join Date
    08-27-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Conditional format for Max value

    Very helpful explanation. Thanks for taking the time.

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Conditional format for Max value

    You're welcome.

+ 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. Replies: 3
    Last Post: 05-15-2013, 12:16 AM
  2. [SOLVED] Copy Conditional Format only without over writing existing format
    By RobNorwichUK in forum Excel General
    Replies: 2
    Last Post: 01-22-2013, 12:20 PM
  3. Replies: 2
    Last Post: 09-26-2012, 04:43 AM
  4. Replies: 0
    Last Post: 05-20-2011, 02:33 PM
  5. Replies: 6
    Last Post: 08-02-2010, 04:05 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