If you want the yellow cells to update without other helper cells then you can use this "array formula" in H2, confirmed with CTRL+SHIFT+ENTER, copied to I2 and down both columns - see attached:
Formula:
=SUM(IF($B$2:$B$100+$C$2:$C$100>=($G2&$F2)+1,IF($B$2:$B$100<=EOMONTH($G2&$F2,0),IF($A$2:$A$100=RIGHT(H$1)+0,IF($B$2:$B$100+$C$2:$C$100-1>EOMONTH($G2&$F2,0),EOMONTH($G2&$F2,0),$B$2:$B$100+$C$2:$C$100-1)-IF($B$2:$B$100<($G2&$F2)+0,($G2&$F2)+0,$B$2:$B$100)+1))))
I added the orange cells to verify that the total number of days in column B matches the total number of days in the yellow table
Bookmarks