MATLAB: Finding a value based on multiple conditions of the next row

finding conditional valuesrow indexing

I need to find the row in a csv that comes right before a row where multiple conditions are met for example, the .csv look something like:
I basically need the DisttoStartPoint at of Procedure 1 when Procedure 2 has a DriveTime of <1
I can get the DistToStartPoint of the Procedure 2 by using condtions but I can not figure out how to get the info from the previous row.
Thank you.

Best Answer

idx = find(DrivenTime(Procedure==2)) ;
PReviousRow = idx(1)-1