+ Reply to Thread
Results 1 to 6 of 6

Compare data in multiple columns to find duplicates & conditionally highlight

  1. #1
    Registered User
    Join Date
    10-25-2010
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    21

    Compare data in multiple columns to find duplicates & conditionally highlight

    hi all,

    I am attempting to use conditional highlighting to highlight duplicate values in a range of data in excel 2007.

    Here is exactly what I want:
    Column A is a function of a 'toggle switch'. So if I change conditions of the toggle switch the values in column A change.

    Columns B through N have static values in them. Some columns have duplicate values within them (i.e. column B has two entries for 'iphone')

    I want cells within each column (B:N) to highlight when they match a value in column A.

    Example:
    Column A
    iphone
    Blackberry
    Nokia
    Column B
    motorola
    Ericsson
    Samsung
    Column C
    LG
    iPhone
    Blackberry
    Sanyo

    Ideally, this formula would be backwards compatible with excel 2003.

    I'm not familiar with VB so I need it to be a function.

    I uploaded an example file to show you what I am looking to do.
    In the worksheet called 'stage summary', i have it set up as follows:

    Range A6:A150: values are a function of the cell A2 which can be toggled to one of several different options. (example: select 'unclassified' from the drop-down menu in A2 and you will have only 1 value in range A6:A150. If you select all, you'll have 132 entries).
    Array B6:M150 are autopopulated cells taken from the worksheet 'Targets'. The cells do not change in response to changes in cell A2.

    What I want, is for cells in the array B6:M150 to highlight red when they are duplicates of values in the range A6:A150.

    PROBLEM: Some values appear more than once in array B6:M150 (example: Exa77 appears across several different stages and twice within one stage). I don't want these values highlighted unless they match a value in column A.

    Thanks very much.

  2. #2
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Compare data in multiple columns to find duplicates & conditionally highlight

    What about selecting the range B6:M200, going to conditional formatting and using the formula and choose the format fill of your choice:
    =AND(COUNTIF($A:$A,B6)>0,B6<>"")
    Last edited by ron2k_1; 07-04-2011 at 07:45 PM. Reason: Provision for blank cells
    Ron
    Knowledge is knowing that a tomato and pepper are fruits. Wisdom is knowing whether to put these in a fruit salad

    Kindly

    [1] Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks
    [2] Mark your post [SOLVED] if it has been answered satisfactorily by editing your original post in advanced mode.
    [3] Thank (using the little scale) those that provided useful help; its nice and its very well appreciated

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Compare data in multiple columns to find duplicates & conditionally highlight

    Change your Conditional Formatting formula for B6 to:

    =ISNUMBER(MATCH(B6,$A:$A, 0))

    Then copy that format to B6:M150 using the Format Painter.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Compare data in multiple columns to find duplicates & conditionally highlight

    Quote Originally Posted by JBeaucaire View Post
    Change your Conditional Formatting formula for B6 to:

    =ISNUMBER(MATCH(B6,$A:$A, 0))

    Then copy that format to B6:M150 using the Format Painter.
    Just in case he wants to apply conditional formatting to unused ranges for future use, you may need to provide for blank cells as well as I did on my example.

  5. #5
    Registered User
    Join Date
    10-25-2010
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    21

    Smile Re: Compare data in multiple columns to find duplicates & conditionally highlight

    Quote Originally Posted by JBeaucaire View Post
    Change your Conditional Formatting formula for B6 to:

    =ISNUMBER(MATCH(B6,$A:$A, 0))

    Then copy that format to B6:M150 using the Format Painter.
    Wow! This appears to work great.
    You guys truly are Excel geniuses! I really appreciate your help.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Compare data in multiple columns to find duplicates & conditionally highlight

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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