I am trying to set up a spreadsheet that detects conflicts within a date range amongst the same names. For example:
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):
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.
Name | Start | End | Conflict? |
Blue | 10-Feb-20 | 16-Feb-20 | Yes |
Blue | 9-Feb-20 | 15-Feb-20 | Yes |
Red | 1-Feb-20 | 5-Feb-20 | No |
Red | 10-Feb-20 | 16-Feb-20 | Yes |
Red | 12-Feb-20 | 15-Feb-20 | Yes |
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):
Name | Start | End | Conflict? |
Blue | 10-Feb-20 | 16-Feb-20 | Yes |
Blue | 9-Feb-20 | 15-Feb-20 | Yes |
Red | 1-Feb-20 | 5-Feb-20 | No |
Red | 10-Feb-20 | 16-Feb-20 | No |
Red | 12-Feb-20 | 15-Feb-20 | Yes |
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: