+ Reply to Thread
Results 1 to 9 of 9

Highlight matching cells in at least 2 arrays

  1. #1
    Registered User
    Join Date
    05-05-2015
    Location
    Canada
    MS-Off Ver
    Office 2013, Office365
    Posts
    4

    Highlight matching cells in at least 2 arrays

    Hi there! I'm new to using more advanced formulas, and I've not yet hit on the right combination of factors to solve my problem.

    I've got 3 sets of dates, and I need to make sure that there are no overlaps or conflicts between the data sets. If the schedule for one product starts on Dec 1 and ends Dec 8, I need to make sure none of the other schedules start/end on either Dec 1 or 8. The list of dates for each product is extensive, which is why I'm looking for a formula instead of casting an eye over it manually.

    For example:

    Data Set #1

    Thursday, November 03, 16 - Saturday, November 12, 16
    Saturday, November 12, 16 - Tuesday, November 22, 16
    Tuesday, November 22, 16 - Saturday, December 10, 16

    needs to not conflict with

    Data Set #2

    Sunday, November 06, 16 - Tuesday, November 15, 16
    Tuesday, November 15, 16 - Thursday, November 24, 16
    Thursday, November 24, 16 - Friday, December 02, 16

    or with

    Data Set #3

    Tuesday, November 08, 16 - Thursday, November 17, 16
    Thursday, November 17, 16 - Monday, December 05, 16
    Monday, December 05, 16 - Wednesday, December 14, 16

    I need a formula to check these against each other. If it needs to be in separate functions (ie. "Does #1 conflict with #2?" and "Does #1 conflict with #3?"), that is okay. I'd also prefer that any dates that do pose a conflict are highlighted for easy notice.

    Does anyone know how to do what I'm looking for? Using Excel 2013, Windows 7.

    Thanks!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Highlight matching cells in at least 2 arrays

    Each single date is in its own cell, right?

    For example:

    A2: Thursday, November 03, 16
    B2: Saturday, November 12, 16

    And even more important, these are real Excel dates and not TEXT strings?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    05-05-2015
    Location
    Canada
    MS-Off Ver
    Office 2013, Office365
    Posts
    4
    Definitely. I just wanted to make it clear that these are closed date ranges. They do not appear as text.

    Quote Originally Posted by Tony Valko View Post
    Each single date is in its own cell, right?

    For example:

    A2: Thursday, November 03, 16
    B2: Saturday, November 12, 16

    And even more important, these are real Excel dates and not TEXT strings?

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Highlight matching cells in at least 2 arrays

    I'm going to bump this thread so I won't forget about it!

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Highlight matching cells in at least 2 arrays

    Can you post a sample file with the above data in it so I can see the layout?

  6. #6
    Registered User
    Join Date
    05-05-2015
    Location
    Canada
    MS-Off Ver
    Office 2013, Office365
    Posts
    4

    Re: Highlight matching cells in at least 2 arrays

    Thanks for taking an interest, Tony.

    Attached is a simplified version of what I'm working with. The Start and End dates are less important; it's the Embark and Disembark days that need to avoid conflict. Manually highlighted in red are dates that I already know to be in conflict. Below each table is my attempt to use COUNTIFS to solve the issue, but it clearly hasn't identified the known problem, and is therefore not going to work.

    I could have removed the "Nights" column for the example, but I have a feeling it's going to throw off the ability to use arrays, so I left it in to show the reality of what I'm working with.

    Even more advanced, but not exactly necessary, is the possibility of involving the EMB and DIS columns on the far right. The dates can conflict, if for example, one product is Embarking from USH and the other is Disembarking in PUQ. However, we will still be miles ahead of where we are currently if we can at least identify matching dates.

    It's useful to know that the dates are already using formulas to calculate themselves, based on manual entry of the number of nights of each unit and the starting date. If it's possible to enter a formula into conditional formatting to highlight any cell that matches the results of another cell, that'd be my goal solution.

    I hope that's enough to work with, but let me know if there are any details I've left out.
    Attached Files Attached Files

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Highlight matching cells in at least 2 arrays

    Sorry for the delayed response! Been pretty busy lately.

    Hmmm...

    It looks like you can do this...

    Select the range C6:C19
    Conditional Formatting
    Use the "Use a formula..." option
    Formula:

    =COUNTIF($C$27:$C$38,C6)+COUNTIF($E$27:$E$38,C6)+COUNTIF($C$46:$C$61,C6)+COUNTIF($E$46:$E$61,C6)

    Select the format style of your choice.

    You would have to repeat this process for each of the ranges.

  8. #8
    Registered User
    Join Date
    05-05-2015
    Location
    Canada
    MS-Off Ver
    Office 2013, Office365
    Posts
    4

    Wink Re: Highlight matching cells in at least 2 arrays

    Tony!! I don't think I was very clearheaded when I attempted to implement your solution before; I didn't think it worked for my needs. I was wrong - it works perfectly! I was even able to get it to work for another outside component that affects one of the data sets, and put those conflicts in another format.

    Thank you very much. This was wonderfully solved.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Highlight matching cells in at least 2 arrays

    You're welcome. Thanks for the feedback!

+ 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. vba compare arrays and remove exact matching arrays
    By jacojvv in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-25-2013, 07:30 AM
  2. Replies: 5
    Last Post: 09-05-2013, 08:59 AM
  3. [SOLVED] How to find all unique, matching values betwen two arrays of cells
    By exmonkey in forum Excel General
    Replies: 11
    Last Post: 06-20-2012, 05:47 PM
  4. Replies: 0
    Last Post: 02-06-2012, 04:06 PM
  5. Matching by Arrays instead of individual cells
    By wilro85 in forum Excel General
    Replies: 1
    Last Post: 08-11-2009, 12:01 PM

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