I need to identify the total penalty incurred within a 30 day period using 30 minute interval data. The 30 minute interval data values are required to be between 39-42 and if they are not a $200 penalty is incurred. The part I'm having trouble with is that if a penalty is incurred there is a 12 hour rectification period so I would need the formula to skip the next 12 hours (24 rows) then begin searching for values outside of the range again and continue adding the $200 penalty as necessary. Also, the 12 hour rectification period only accumulates during the working hours of 7am-4pm, so if a value falls outside of 39-42 at 11pm, the 12 hours would begin at 7am and end at 10am the following day.