A B a 1 a 20 a 25 a 40 a 52 b 3 b 80 In this example, B-30 would be A B B-30 a 1 -29 a 20 -10 a 25 -5 a 40 10 a 52 22 b 3 -27 b 80 50 Then, I want column C to contain minimum value of B, but larger or equal to B-30 within same ID. The fourth row should find minimum B, within the same group a (1, 20, 25, 40, 52) and larger or equal to 40-30 (20, 25, 40, 53). Actually, column B contains the dates of visit, and I want to get the foremost day of visit within 30 previous days.
... View more