Hello Mike,
In the attached file, I removed the unnecessary SUM functions. Also, I modified the formulas in these cells:
J4=INDEX(D12:D22,
MATCH(J3,D12:D22,-1)+1)
E12=IF(D12>D$5,
E13+J$7,
D12)
Hopefully, this version will ultimately resolve your issues.
Cheers!
Twifoo