I did this in two steps.
1. Enter this in C4 and fill down. The formula will give the times for ON and OFF.
Formula:
=IF(AND(B4=-1,B3=0),A4,IF(AND(B4=0,B3=-1),A4,""))
2. This formula will take every second value in column C starting with the smallest value. Enter this formula in E9 and fill down:
Formula:
=SMALL($C$4:$C$44,(ROWS($E$9:E9)-1)*2+1)
Enter this in F9 and fill down (the same formula as above but with the change of +1 to +2. This takes every second value starting with the second smallest value.
Formula:
=SMALL($C$4:$C$44,(ROWS($E$9:F9)-1)*2+2)
Bookmarks