+ Reply to Thread
Results 1 to 14 of 14

Ignore Duplicate Values In Conditional Formatting

  1. #1
    Registered User
    Join Date
    09-12-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Ignore Duplicate Values In Conditional Formatting

    I'm using Excel 2007. I'd like to know if there is a way to tell Excel to ignore duplicate values when applying a conditional format.

    I've posted an example workbook.
    Attached Files Attached Files
    Last edited by mightyeskimo; 09-18-2010 at 12:25 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Ignore Duplicate Values In Conditional Formatting

    Here, try this in CF:

    =COUNTIF($U$5:$U6, $U6)=1
    Attached Files Attached Files

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Ignore Duplicate Values In Conditional Formatting

    It might be easier with the aid of a helper column..

    Say in T5 you enter:

    =IF(COUNTIF(S$5:S5,S5)=1,S5,"")

    copied down,

    Then the conditional format formula for S5:S23 would be:

    =AND($T5<>"",S5>=LARGE($T$5:$T$23,10))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    09-12-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Ignore Duplicate Values In Conditional Formatting

    Can you elaborate on your reply zbor? I don't understand where you're going.

    I really need a way to do this without a helper column NBVC because I would then have to create hundreds of helper columns for each column I want to format.

    Thanks very much for your help!
    Last edited by mightyeskimo; 09-13-2010 at 03:16 PM.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Ignore Duplicate Values In Conditional Formatting

    I think zbor's suggestion assumes the top 10 values are the actual top 10 items in your list... if that is true, then just select the range and apply the conditional format he supplied, and if you can sort the data this way, it might very well work for you...

    I have a funny feeling, it isn't that straightforward, and than you can have duplicates within the first 10 values, and also that the numbers are always so sequential.. that is why I supplied my solution.. but I am having some difficulty getting it in a single formula... I can't account for 1 of the duplicates being a valid entry into an array... this may require VBA (which would be beyond me). Maybe someone knows of a trick that I can't yet figure out....

  6. #6
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Ignore Duplicate Values In Conditional Formatting

    My take on this. I tweaked the data a little to make them less "straithforward".
    Attached Files Attached Files

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Ignore Duplicate Values In Conditional Formatting

    Well, there you go...

    my excuse... it is late in the day and have been racking my brain in some crystal reports forms all day

    Good job, WHER...

  8. #8
    Registered User
    Join Date
    09-12-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Ignore Duplicate Values In Conditional Formatting

    Thanks WHER! That's awesome! Would I be correct to assume that if I change LARGE to SMALL that the bottom 10 values would be formatted? Thanks NBVC and zbor too!

  9. #9
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Ignore Duplicate Values In Conditional Formatting

    A quick test seems to confirm your assumption, but don't forget to also change the ">=" to "<="

  10. #10
    Registered User
    Join Date
    09-12-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Ignore Duplicate Values In Conditional Formatting

    Can I somehow use the fill handle to drag these rules to adjacent columns of the same size?

  11. #11
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Ignore Duplicate Values In Conditional Formatting

    Not the fill handle, but the "format brush" if that still exists in Excel 2007?
    But first a small modification to the formula is needed: select U5, then go to Format >> Conditional Format >> instead of "countif($U$5:U5,U5)" modify to "countif(U$5:U5,U5)"

  12. #12
    Registered User
    Join Date
    09-12-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Ignore Duplicate Values In Conditional Formatting

    I bumped this thread to ask two follow up questions. The number of rows that my data occupies will always be subject to change. As a result, I'd like to avoid the repetative task of dragging up or down the range to make sure the conditional formatting applies to the correct range of cells. I am able to estimate, with a very good amount of accuracy, the number of rows the data range will never exceed. What I'd like to do is have Excel ignore cells that are empty while performing the format.

    My second question is much like the first. Some cells in the range, due to the formulas therein, will result in #N/A values. Is it possible to tell Excel to ignore these values as well?

  13. #13
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Ignore Duplicate Values In Conditional Formatting

    Can you post a representative sample (doesn't have to be full size, just 20 or 30 values) showing numbers in the order you would expect them, with spaces and #N/As.

    Also explain which values should be formatted - thanks
    Audere est facere

  14. #14
    Registered User
    Join Date
    09-12-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Ignore Duplicate Values In Conditional Formatting

    Updated Attachment as example.
    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)

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