This is another way to do the STRAIGHTLINE. In K2 filled down and across.
=IFERROR(INDEX(FREQUENCY(ROW(INDEX(A:A,$E6):INDEX(A:A,$E6-1+$D6/($H6/365*$D6))),EOMONTH($E6,ROW($1:$100)-1))*$H6/365*$D6,
MATCH(EOMONTH(K$4,0),INDEX(EOMONTH($E6,ROW($1:$500)-1),0),1)),0)
It returns all the same values you expect except for S8. I get $67.35. You are expecting $139.55.
Bookmarks