I am trying to find a way to return the nearest preceding row in a dataframe that meets two criteria: