+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatting Duplicate Values (Upper & Lower Case)

  1. #1
    Registered User
    Join Date
    03-04-2010
    Location
    South Florida
    MS-Off Ver
    Excel 2007
    Posts
    72

    Conditional Formatting Duplicate Values (Upper & Lower Case)

    Hi,

    Can someone help me out with a conditional formatting formula for duplicate values? I have two columns of data, one column is lower case, the other column is upper case. I've tried to use the built in formula, but it's not working -- I'm guessing it's due to upper/lower case.

    Thanks.

  2. #2
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Conditional Formatting Duplicate Values (Upper & Lower Case)

    You can use the COUNTIF function:
    if you want to check to see if a value in the A column matches a value in the B column use (with A1 selected). Use =Countif(B:B,A1)>0 as your formula. I've attached an example.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-04-2010
    Location
    South Florida
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: Conditional Formatting Duplicate Values (Upper & Lower Case)

    MDBCT,

    I can't seem to get the formula to work with my data. Could you look at my Excel file?

    Thanks for your response.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Conditional Formatting Duplicate Values (Upper & Lower Case)

    It is not working correctly because there is a space at the end of the values in the B column that is not present in the A column.

  5. #5
    Registered User
    Join Date
    03-04-2010
    Location
    South Florida
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: Conditional Formatting Duplicate Values (Upper & Lower Case)

    I'm not sure what you mean, could you highlight what you're talking about?

    Thanks.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Conditional Formatting Duplicate Values (Upper & Lower Case)

    mdbct is making the point that if you compare the length of the cells in Col A to their equivalent in Col B you will find Col B is longer - it has a trailing space.

    Native Excel for the most part is not case sensitive (apple = Apple) - there are a few functions where this does not hold true but neither Match nor Countif are case sensitive.

    It follows then that the failed duplicate test is down not to case sensitivity but to the fact that "apple" <> "Apple "

    If you can't alter the original values (advised) you need to account for the trailing space either by

    a) using Wildcard in Countif - open to false positives

    b) using Trim in the Match
    (I would suggest you use a Trim based approach if the originals are to be left as they are).
    Regards your file... it's not really clear which cells you want to Conditionally Format.

    If we assume for sake of demo you wish to highlight all instances of a match (ie A & B values simultaneously) then with A6:B11 highlighted (having selected A6 first) apply a Conditional Formula rule of:

    Please Login or Register  to view this content.
    using your sample the above would format B6 and A10...

    The above takes advantage of the fact that with Conditional Formatting

    a) formulae are processed as Arrays by default

    b) errors evaluate as False

    c) conditional formatting is applied where result is True (and in Excel any number other than 0 is True)
    Last edited by DonkeyOte; 03-05-2010 at 04:05 AM. Reason: added explanation as to why it works - added tags for visibility

+ 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