If you sort the list in N1:N7 in ascending order, then you can use this formula:
=SUMPRODUCT(SUMIF(INDIRECT("'"&INDEX($N$1:$N$7,MATCH($E$8,$N$1:$N$7,0)):INDEX($N$1:$N$7,MATCH($G$8,$N$1:$N$7,0))&"'!B:B"),$C15,INDIRECT("'"&INDEX($N$1:$N$7,MATCH($E$8,$N$1:$N$7,0)):INDEX($N$1:$N$7,MATCH($G$8,$N$1:$N$7,0))&"'!G:G")))