Yes. Apologies, I've never dealt with a workbook of this size. Easy to get lost.

I believe I've found part of the solution: =IF(AND(D30=1023,D29=1023),A30-A29,"")

This would account for large sequences of 1023, but it doesn't account for 321 or single values of 1023. I could use the same structure for 321s. For single values of 1023, I believe it would work to say =IF(AND(D31=0,D30=1023,D29=0),A31-A29,"").