use:
={{QUERY(TESTDATA!A1:C, "select A,sum(C) group by A pivot B", 1),
QUERY(TESTDATA!A1:C, "select sum(C) group by A label sum(C) 'NAME TOTAL'")}; TRANSPOSE(
QUERY(TESTDATA!A1:C, "select sum(C) group by B label sum(C) 'MONTH COLUMN TOTALS'"))}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…