Hello,
I need to calculate the average temperature in a cycle of 30s, and my temperature log is taking one reading every 15 sec. I recorded cycle end time, and I would like to write script to calculate the average temperature during 30s prior to the cycle end time.
| Time | Cycle End Time | Temperature |
| 6/26/2018 13:45:00 | 6/26/2018 13:46 | 22.32 |
| 6/26/2018 13:45:15 | 6/26/2018 13:46 | 22.52 |
| 6/26/2018 13:45:30 | 6/26/2018 13:46 | 22.62 |
| 6/26/2018 13:45:45 | 6/26/2018 13:46 | 22.55 |
| 6/26/2018 13:46:00 | 6/26/2018 13:46 | 22.41 |
| 6/26/2018 13:46:15 | 6/26/2018 13:48 | 22.32 |
| 6/26/2018 13:46:30 | 6/26/2018 13:48 | 22.18 |
| 6/26/2018 13:46:45 | 6/26/2018 13:48 | 22.54 |
| 6/26/2018 13:47:00 | 6/26/2018 13:48 | 22.51 |
| 6/26/2018 13:47:15 | 6/26/2018 13:48 | 22.46 |
| 6/26/2018 13:47:30 | 6/26/2018 13:48 | 22.35 |
| 6/26/2018 13:47:45 | 6/26/2018 13:48 | 22.28 |
| 6/26/2018 13:48:00 | 6/26/2018 13:48 | 22.51 |
The final table I would like is :
| Time | Cycle End Time | Temperature | Average Temperature in Cycle |
| 6/26/2018 13:45:00 | 6/26/2018 13:46 | 22.32 | 22.585 |
| 6/26/2018 13:45:15 | 6/26/2018 13:46 | 22.52 | 22.585 |
| 6/26/2018 13:45:30 | 6/26/2018 13:46 | 22.62 | 22.585 |
| 6/26/2018 13:45:45 | 6/26/2018 13:46 | 22.55 | 22.585 |
| 6/26/2018 13:46:00 | 6/26/2018 13:46 | 22.41 | 22.585 |
| 6/26/2018 13:46:15 | 6/26/2018 13:48 | 22.32 | 22.38 |
| 6/26/2018 13:46:30 | 6/26/2018 13:48 | 22.18 | 22.38 |
| 6/26/2018 13:46:45 | 6/26/2018 13:48 | 22.54 | 22.38 |
| 6/26/2018 13:47:00 | 6/26/2018 13:48 | 22.51 | 22.38 |
| 6/26/2018 13:47:15 | 6/26/2018 13:48 | 22.46 | 22.38 |
| 6/26/2018 13:47:30 | 6/26/2018 13:48 | 22.35 | 22.38 |
| 6/26/2018 13:47:45 | 6/26/2018 13:48 | 22.28 | 22.38 |
| 6/26/2018 13:48:00 | 6/26/2018 13:48 | 22.51 | 22.38 |
Does anyone know how to do that?