ok try this
sort your data first on column "direction" then ascending on the time column
this will separate your AB from your BA directions and give you successive observations for each direction
separately for the ABs and BAs
type "start" against the FIRST trip for each direction in column S (10:52:40 for AB and 10:52:33 for BA in your example)
in the cell below (S30 in my working, you may need to tweak) type this formula:
copy this formula to the remaining rows for all the ABs and BAs
this says:
if the previous row is not the start of the journey, this row is the start of the journey
if this row is not the start of the journey, and the trip took more than 20 seconds, it went into the yard
if this row is not the start of the journey, and the trip took less than 20 seconds, return the time taken
is this roughly what you want?
Bookmarks