I have a DB which contains shipping orders for different clients, one shipment can have more than one dispatch with different estimated arrival times, the logic is: dispatches on each route must follow a sequential order (06:00->06:30->08:00) and not (06:30->08:00->06:00) all times are in the same column but the route number is on another column. Validation must be done only for dispatches in the same route.
First I tried using a separate sheet with cells calculating the difference between each time and the next in the route but I get errors when the formula encounters blank cells. The formula was:
=IF(COUNTIFS($I$2:$I$2000;$I2;$A$2:$A$2000;$A$2)>1;$E3-$E2;0)
I used COUNTIFS() to validate the dispatch wan on the same route for the same dispatch center, since the DB consolidates 5 dispatch centers. The formula returned negative numbers when it detected an incorrect sequence, but it was detectting false positives between the last and first dispatches on adjacent routes.
I then tried to use conditional formatting to check this, using:
=IF(COUNTIFS($I$2:$I$2000;I2;$A$2:$A$2000;A2)>1;E3<E2;0)
However, something is not right... I would appreciate if someone could give me an insight to make this work, or if there is another way to do this validation (I am sure there is one, but I'm not yet aware of it). Please help.
Sample data clarified, and it is showing the expected result, need to avoid the false positives. please help