I'm having trouble with writing the logic for the formula
The results should be as above.
Markdown table
| Closing TEU | Average per day | ||
|---|---|---|---|
| 23/3/2022 | 62 | no | 120 |
| 24/3/2022 | 49 | no | 120 |
| 25/3/2022 | 168 | 48 | 120 |
| 26/3/2022 | 148 | 28 | 120 |
| 27/3/2022 | 122 | 2 | 120 |
| 28/3/2022 | 170 | 50 | 120 |
| 29/3/2022 | 94 | no | 109 |
| 30/3/2022 | 62 | no | 109 |
| 31/3/2022 | 171 | 51 | 109 |
| 1/4/2022 | 76 | no | 119 |
| 2/4/2022 | 161 | 41 | 119 |
| 3/4/2022 | 21 | no | 105 |
| 4/4/2022 | 189 | 69 | 105 |
| 5/4/2022 | 17 | no |
Looking to average the closing TEU by the value spikes. For example per day the set value is 120 so if exceeds this value, it needs to be averaged into the previous day.The range stops at the highest spikes. Once the range is set like 23/3 - 28/3 will be taken out of the equation and the tabulation will start anew. preferably a formula solution instead of code as there will be daily sheets.
