+ Reply to Thread
Results 1 to 9 of 9

Highlighting duplicates based on multiple criteria

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    13

    Highlighting duplicates based on multiple criteria

    In the attached sheet, I'm needing to highlight duplicates in the "Scheduled" column if "Technician" column matches but the "Scheduling group" doesn't.
    In the below ref, both of the dates is the Scheduled column would be highlighted because they're in different groups using the same technician.

    Site | SGroup | Tech | Scheduled
    A | 1a | DM | 5/19/21
    B | 2b | DM | 5/19/21

    I can't seem to figure this one out. Is it even possible?

    Thanks in advance for any ideas.
    Lisa
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,701

    Re: Highlighting duplicates based on multiple criteria

    Select A2:D13 and use CF formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,758

    Re: Highlighting duplicates based on multiple criteria

    The conditional formatting formula

    =COUNTIFS($D$2:$D$13,D2,$C$2:$C$13,C2,$B$2:$B$13,"<>"&B2)

    will do it. Implemented in attached file, though it's not the same data as in your post. I also fixed the typo in the column C heading.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    10-22-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Highlighting duplicates based on multiple criteria

    This one worked perfect. I still don't understand it, but I'm glad it works. Thank you!!!

    Quote Originally Posted by 6StringJazzer View Post
    The conditional formatting formula

    =COUNTIFS($D$2:$D$13,D2,$C$2:$C$13,C2,$B$2:$B$13,"<>"&B2)

    will do it. Implemented in attached file, though it's not the same data as in your post. I also fixed the typo in the column C heading.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,758

    Re: Highlighting duplicates based on multiple criteria

    For each row, it counts the number of occurrences in the whole data set where:

    $D$2:$D$13,D2 The Date is the same
    $C$2:$C$13 The Tech is the same
    B$2:$B$13,"<>"&B2 The group is not the same

    When the count is >0, the cell is highlighted.

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

    Re: Highlighting duplicates based on multiple criteria

    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

    If a member helped you solve your problem, consider adding to their reputation by clicking on the star icon addreputationiconsmall.jpg below their name.

  7. #7
    Registered User
    Join Date
    10-22-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Highlighting duplicates based on multiple criteria

    Got it. Thank you for the walk-through!

    Quote Originally Posted by 6StringJazzer View Post
    For each row, it counts the number of occurrences in the whole data set where:

    $D$2:$D$13,D2 The Date is the same
    $C$2:$C$13 The Tech is the same
    B$2:$B$13,"<>"&B2 The group is not the same

    When the count is >0, the cell is highlighted.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,758

    Re: Highlighting duplicates based on multiple criteria

    By the way

    B$2:$B$13,"<>"&B2

    Have you ever done this in a COUNTIF? If not: Usually in COUNTIF, you put a range, then a value. It counts all the cells in the range that are equal to that value. However, if you want a comparison that is anything other than equal, you have to build a string. The above uses the "<>" operator and concatenates the value in B2. You can also do < > <= >=. Because you are building a string you can also do arithmetic, like

    $Z$2:$Z$13,">"&(TODAY()+30)

    will count dates more than 30 days in the future.

  9. #9
    Registered User
    Join Date
    10-22-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Highlighting duplicates based on multiple criteria

    I think I've used it one other time, but I hadn't thought to apply it to an arithmetic situation. I think that application will have some added value for the current sheet I'm working on. Thank you!
    Last edited by 6StringJazzer; 03-26-2021 at 10:49 AM. Reason: No need to quote entire posts when responding

+ 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. [SOLVED] Highlighting multiple duplicates based on two columns
    By cologg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-11-2021, 03:11 AM
  2. Highlighting duplicates based on the date it's under.
    By mutzie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-11-2019, 12:24 AM
  3. Need help identifying duplicates based on multiple criteria
    By Roxie#2013 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-18-2016, 02:25 PM
  4. [SOLVED] highlighting multiple rows based on multiple criteria
    By Dena in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-12-2015, 12:44 PM
  5. Remove duplicates based on multiple criteria
    By cbwilliams in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-18-2015, 05:12 PM
  6. Highlighting cells based off multiple criteria
    By mstieler in forum Excel General
    Replies: 0
    Last Post: 02-20-2013, 07:26 PM
  7. [SOLVED] Deleting Duplicates Based on Multiple Criteria from Multiple Columns
    By Franklic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2012, 05:31 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