try:
={{QUERY({A3:C}, "select Col1,sum(Col2) where Col1 is not null group by Col1 pivot Col3", 1),
QUERY(QUERY(QUERY({A3:C}, "select sum(Col2) where Col1 is not null group by Col1 pivot Col3", 1),
"select (Col2-Col1)/Col1 label (Col2-Col1)/Col1'Calculated column' format (Col2-Col1)/Col1 '0.00%'"))};
{"Grand Total", INDEX(QUERY({A3:C}, "select sum(Col2) where Col1 is not null pivot Col3", 1), 2), ""}}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…