▼完整公式 =LET(t,GROUPBY(A2:A11,B2:C11,IF({1,0},SINGLE,TOCOL(B1:C1)),0,0),REDUCE({"班级","类别","书名"},SEQUENCE(ROWS(t)),LAMBDA(x,y,VSTACK(x,LET(R,CHOOSEROWS(t,y),k,TAKE(R,,2),S,REGEXEXTRACT(@TAKE(R,,-1),".+?(?=《|$)",1),IFERROR(HSTACK(k,TOCOL(S)),k))))))
▼完整公式 =LET(t,GROUPBY(A2:A11,B2:C11,IF({1,0},SINGLE,TOCOL(B1:C1)),0,0),REDUCE({"班级","类别","书名"},SEQUENCE(ROWS(t)),LAMBDA(x,y,VSTACK(x,LET(R,CHOOSEROWS(t,y),k,TAKE(R,,2),S,REGEXEXTRACT(@TAKE(R,,-1),".+?(?=《|$)",1),IFERROR(HSTACK(k,TOCOL(S)),k))))))