This is what I have so far. It worked fine before adding in the BinCounts ref.
=query(
{'Aggregated Data'!A2:G , BinCounts!A2:G}, "SELECT A, B, C, E, DAY(B), YEAR(B)" & if(COUNTBLANK(Sheet14!A1:A4)=4,""," WHERE " & TEXTJOIN(" AND ", True, Sheet14!A1:A4) & "WHERE Col1 <>"),1)
question from:
https://stackoverflow.com/questions/65904737/in-gsheets-how-do-i-pull-data-from-multiple-sheets-within-the-workbook-in-a-quer 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…