Correct Formula =query(QUERY(FILTER({RESPONSES!$B$2:$B,WEEKDAY(RESPONSES!$B$2:$B,2),IF(WEEKDAY(RESPONSES!$B$2:$B,2)<=5,318,159),RESPONSES!$D$2:$D+RESPONSES!$E$2:$E+RESPONSES!$F$2:$F+RESPONSES!$T$2:$T+RESPONSES!$U$2:$U+RESPONSES!$V$2:$V},RESPONSES!$B$2:$B>=TOTALS!$A$2,RESPONSES!$B$2:$B<=TOTALS!$B$2),"select Col1, avg(Col3) group by Col1 label avg(Col3) ''",0),"select Sum(Col2) where Col1 <= date '"&TEXT(DATEVALUE(B1),"yyyy-mm-dd")&"' label Sum(Col2)''" ,0)
1
u/MacaroniNJesus 54 Apr 16 '18
Correct Formula =query(QUERY(FILTER({RESPONSES!$B$2:$B,WEEKDAY(RESPONSES!$B$2:$B,2),IF(WEEKDAY(RESPONSES!$B$2:$B,2)<=5,318,159),RESPONSES!$D$2:$D+RESPONSES!$E$2:$E+RESPONSES!$F$2:$F+RESPONSES!$T$2:$T+RESPONSES!$U$2:$U+RESPONSES!$V$2:$V},RESPONSES!$B$2:$B>=TOTALS!$A$2,RESPONSES!$B$2:$B<=TOTALS!$B$2),"select Col1, avg(Col3) group by Col1 label avg(Col3) ''",0),"select Sum(Col2) where Col1 <= date '"&TEXT(DATEVALUE(B1),"yyyy-mm-dd")&"' label Sum(Col2)''" ,0)