Task overlap

webdevptg

Board Regular
Joined
May 2, 2019
Messages
51
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
  2. Web
In a table I have some fields, Date, Start Time and Duration.
When adding a new task, I need to know if it will not overlap with existing ones. Below I send an image with 3 possible scenarios:
  • In the first scenario, return 1 and that's correct, because the 4-hour task starting at 9:00 would overlap with the 11:00 that already exists on that date.
  • In the second scenario it returns 1 but it is incorrect, because the new task starting at 9:00 am with a duration of 2 hours does not overlap with that of 11:00 am on the same date.
  • In the third scenario it returns 0 and is incorrect, because the session starting at 12:00 will overlap with those at 11:00 am and has 2 hours

Help Please...:eek:



1579693600175.png
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
All the dates on the left are the same .... so, erm, what the hell is going on?????
 
Upvote 0
Overlap formula:

=SUMPRODUCT(--((G2+H2)<($A$2:$A$12+$B$2:$B$12+$C$2:$C$12/24))*--((G2+H2+I2/24)>($A$2:$A$12+$B$2:$B$12)))
 
Upvote 0
Overlap formula:

=SUMPRODUCT(--((G2+H2)<($A$2:$A$12+$B$2:$B$12+$C$2:$C$12/24))*--((G2+H2+I2/24)>($A$2:$A$12+$B$2:$B$12)))

Works fine! (y) (y)

Code:
=SUMPRODUCT(--((E2+F2)<($A$2:$A$12+$B$2:$B$12+$C$2:$C$12/24))*--((E2+F2+G2/24)>($A$2:$A$12+$B$2:$B$12)))
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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