先给几个答案吧:
O2=IF(O$1=$Q$1,TEXT(LARGE(SUMIF(OFFSET($A:$A,,{0,3,6,9}),$M$2:$M$101,OFFSET($C$1,,{0,3,6,9})),ROW(A1)),"#;;"),INDEX(IF($Q2="",$Z:$Z,IF(O$1=$O$1,$1:$1,$M:$M)),INDEX(LEFT(RIGHT(LARGE(SUMIF(OFFSET($A:$A,,{0,3,6,9}),$M$2:$M$101,OFFSET($C$1,,{0,3,6,9}))*10^5+ROW($2:$101)*100+{1,4,7,10},ROW(B1)),{2,5}),3),,COLUMN(A1))))&""
O2=IF(O$1=$Q$1,TEXT(LARGE(SUMIF(OFFSET($A:$A,,{0,3,6,9}),$M$2:$M$101,OFFSET($C$1,,{0,3,6,9})),ROW(A1)),"#;"),INDIRECT(INDEX(IF($Q2="",{"R1C2","R"},{"R1C","R"})&LEFT(RIGHT(LARGE(SUMIF(OFFSET($A:$A,,{0,3,6,9}),$M$2:$M$101,OFFSET($C$1,,{0,3,6,9}))*10^5+ROW($2:$101)*100+{1,4,7,10},ROW(B1)),{2,5}),3)&{"","C13"},,COLUMN(A1)),0))&""
O2=IF(O$1=$Q$1,IF($O2="","",SUMIF(OFFSET($A:$A,,MATCH($O2,$1:$1,)-1),$P2,OFFSET($C$1,,MATCH($O2,$1:$1,)-1))),INDEX(IF(O$1=$O$1,IF($P2="",$Z:$Z,$1:$1),$M:$M),LEFT(RIGHT(LARGE(SUMIF(OFFSET($A:$A,,{0,3,6,9}),$M$2:$M$101,OFFSET($C$1,,{0,3,6,9}))*10^5+ROW($2:$101)*100+{1,4,7,10},ROW(B1)),IF(O$1=$O$1,2,5)),3)))&""
O2=IF(O1=$Q1,TEXT(LARGE(SUMIF(OFFSET($A:$A,,{0,3,6,9}),$M$2:$M$101,OFFSET($C$1,,{0,3,6,9})),ROW(A1)),"#;"),INDEX(IF($Q2="",$Z:$Z,IF(O1=$O1,$1:$1,$M:$M)),LEFT(RIGHT(LARGE(SUMIF(OFFSET($A:$A,,{0,3,6,9}),$M$2:$M$101,OFFSET($C$1,,{0,3,6,9}))*10^5+ROW($2:$101)*100+{1,4,7,10},ROW(B1)),5-($O1=O1)*3),3)))&""
O2=IF(O1=$Q1,TEXT(LARGE(SUMIF(OFFSET($A:$A,,{0,3,6,9}),$M$2:$M101,OFFSET($C$1,,{0,3,6,9})),ROW(A1)),"#;"),INDEX(IF($Q2="",Z:Z,IF(O1=$O1,$1:$1,$M:$M)),RIGHT(LARGE(SUMIF(OFFSET($A:$A,,{0,3,6,9}),$M$2:$M101,OFFSET($C$1,,{0,3,6,9}))*10^3+IF(O1=$O1,{1,4,7,10},ROW($2:101)),ROW(B1)),3)))&"" |