Possibly with an array formula in B57:
confirmed with CTRL+SHIFT+ENTER not just ENTER.
Notice that with this formula you need to define ranges, no whole columns....
then, if the G/L are unique in the Branch sheets, you can use SUMIF
in C57:
=IF(B57="","",SUMIF(INDIRECT("'"&$C$53&" Data'!$B2:$B500"),B57,INDIRECT("'"&$C$53&" Data'!$D2:$D500")))
in D57:
=IF(B57="","",SUMIF(INDIRECT("'"&$C$53&" Data'!$B2:$B500"),B57,INDIRECT("'"&$C$53&" Data'!$E2:$E500")))
copied down,
otherwise use the same array formula above, subbing the last number 1 with 3 and 4 to define column numbers...
Bookmarks