This formula will be placed in E7 then drag down the column till last row.
It will work with separate area for each Flat automatically (means E7 works from row 8 till row 19)
Note: th ere must be an emty row between 2 flats, i.e row 20
=IF(ISTEXT(A7),SUMPRODUCT((INDEX(A8:INDEX(A8:A$85,MIN(IF(ISBLANK(A8:A$85),ROW(A8:$A$85)-MIN(ROW(A8:$A$85)),"")),),)<=TODAY())*(INDEX(C8:INDEX(C8:C$85,MIN(IF(ISBLANK(A8:$A$85),ROW(A8:$A$85)-MIN(ROW(A8:$A$85)),"")),),)-INDEX(D8:INDEX(D8:D$85,MIN(IF(ISBLANK(A8:$A$85),ROW(A8:$A$85)-MIN(ROW(A8:$A$85)),"")),),))),"")
...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
Bookmarks