Using LibreOffice's Calc program (nearly the same functionality as Microsoft Excel) I have a set of numbers in column T, which represent numbers for the week (with labels in S). Each week's worth of data is 3 rows, then a blank row separating it from the next week:

```
S | T
=======
A | 90
B | 180
C | 250
A | 95
B | 160
C | 255
A | 100
B | 175
C | 260
A | 95
B | 185
C | 230
```

Is there a way to calculate the maximum value up until a cell, skipping to every nth row? The data in the other columns for each week and number group is based off the previous week's data in column T, but I would like to use the highest value to date.

Using the data above as an example: for weeks 1, 2, and 3, I would like the B formula to return 180, but on week 4 (where there is a higher number), 185. For the A group, week 1 would be base on 90, then 95 for week 2, 100 for week 3, but then 100 again for week 4.