Try this single copied across down formula
In "Consolidated" sheet C5, formula copied across right and down :
=SUMPRODUCT(SUMIFS(INDEX('Flats-S1'!$D$4:$R$167,,MATCH(C$4,'Flats-S1'!$D$3:$R$3,0)),'Flats-S1'!$D$4:$D$167,">="&MID($B5,{1,9,17},3),'Flats-S1'!$D$4:$D$167,"<="&MID($B5,{5,13,21},3)))
View attachment 79074
Remark :
1] "Consolidated" sheet headers must as same as the Source table (Flats-S1) sheet
2] "Consolidated" sheet -"Flat no." format, please follow my revised one,
That is : 101 to 109 >> 101-109 and 401 >> 401-401
3] Since my computer consider Source table sheet header with (in Rs.) value like 12,00,000/- as text, I changed it to number,
but If your computer can consider (in Rs.) value as number, that is fine, no need to change.
4] All highlighted in blue color cells content are changed, please refer to the attachment.
Regards