I am looking for a way of simplifying this formula since it has to run in 17424 unique cells:
=IFERROR(SUMPRODUCT(QUERY('MASTER Accelo Data 1'!A:G;"Select G where (B>=date '2020-01-01' and B<=date '2020-01-31' and A matches '"&J2&"' and D matches '"&JOIN("|";$T$2:$T)&"')";0));0)+IFERROR(SUMPRODUCT(QUERY('MASTER Accelo Data 2'!A:G;"Select G where (B>=date '2020-01-01' and B<=date '2020-01-31' and A matches '"&J2&"' and D matches '"&JOIN("|";$T$2:$T)&"')";0));0)
where...
MASTER Accelo Data 1!G:G + MASTER Accelo Data 2!G:G = Cells to be summed
MASTER Accelo Data 1!B:B + MASTER Accelo Data 2!B:B= Dates to be checked
J2 = Customer ID
MASTER Accelo Data 1!A:A + MASTER Accelo Data 2!A:A = Customer IDs to be checked
T2:T = Array of owners
MASTER Accelo Data 1!D:D + MASTER Accelo Data 2!D:D = Owners to be checked
Link to dummy workbook: https://docs.google.com/spreadsheets/d/1hevSA0vl3YO81vaxfJ46TAyO-VkUhXKk8WRKY8268qY/edit?usp=sharing
Hoping you guys can help!