Date Range Conflict Checker

Marmasek

New Member
Joined
Nov 20, 2019
Messages
8
I am trying to set up a spreadsheet that detects conflicts within a date range amongst the same names. For example:

NameStartEndConflict?
Blue10-Feb-2016-Feb-20Yes
Blue9-Feb-2015-Feb-20Yes
Red1-Feb-205-Feb-20No
Red10-Feb-2016-Feb-20Yes
Red12-Feb-2015-Feb-20Yes

You can see that within the name Blue, there is a conflict during the dates 10-15 Feb inclusively. Similarly, within the name Red, there is a conflict during the dates 12-15 Feb inclusively.

In order to detect the conflict, I have entered the following array formula into D2:
{=CHOOSE(1+MAX((A2=A$2:A$6)*(B2>=B$2:B$6)*(B2<=C$2:C$6)*(ROW()<>ROW(A$2:A$6)),(A2=A$2:A$6)*(C2>=B$2:B$6)*(C2<=C$2:C$6)*(ROW()<>ROW(A$2:A$6))),"No","Yes")}

It detects conflicts when a date is within another conflicted date but not when the dates overlap. For example (the same table as above, but with the array formula put into column D):

NameStartEndConflict?
Blue10-Feb-2016-Feb-20Yes
Blue9-Feb-2015-Feb-20Yes
Red1-Feb-205-Feb-20No
Red10-Feb-2016-Feb-20No
Red12-Feb-2015-Feb-20Yes

As you can see, there should be an indicated conflict on D5, but it shows as No.

If someone could help me find a formula that works to detect all date range conflicts as I demonstrated in the first table above, I would appreciate it very much.

Thank you.
 
Last edited:

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Book1
BCDE
5NameStartEndConflict
6Blue2/10/20202/16/2020Yes
7Blue2/9/20202/15/2020Yes
8Red2/1/20202/5/2020No
9Red2/10/20202/16/2020Yes
10Red2/12/20202/15/2020Yes
Sheet12
Cell Formulas
RangeFormula
E6:E10E6=CHOOSE((SUMPRODUCT((C6<=$D$6:$D$10)*(D6>=$C$6:$C$10))>1)+1,"No","Yes")
 
Upvote 0
Thank you for your reply.

This formula detects conflicts as I would like them to, however it doesn't take the name into account. Using the formula you gave me, altering some dates and names, I have this result:

Blue
10-Feb-20​
16-Feb-20​
Yes
Blue
09-Feb-20​
15-Feb-20​
Yes
Red
13-Mar-20​
14-Mar-20​
Yes
Blue
10-Mar-20​
16-Mar-20​
Yes
Red
12-Mar-20​
15-Mar-20​
Yes

However the result I am looking for is as follows:
Blue
10-Feb-20​
16-Feb-20​
Yes
Blue
09-Feb-20​
15-Feb-20​
Yes
Red
13-Mar-20​
14-Mar-20​
Yes
Blue
10-Mar-20​
16-Mar-20​
No
Red
12-Mar-20​
15-Mar-20​
Yes

The third blue item has no conflict since it doesn't conflict with the other blue items, even if the dates do conflict with the red items.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top