格式一
=LET(a,TOCOL(A4:A999,1),a_a,FILTER(a,MOD(SEQUENCE(ROWS(a)),2)=1)&FILTER(a,MOD(SEQUENCE(ROWS(a)),2)=0),r,REDUCE({"姓名","实发金额","管辖地区"},a_a,LAMBDA(x,y,LET(b,TEXTBEFORE(TEXTAFTER(y,".",1),{"大区","地区"}),c,TEXTBEFORE(TEXTAFTER(y,{"大区","地区"}),"(",1),d,--TEXTAFTER(y,{"共计实发:","共计实发"}),VSTACK(x,HSTACK(c,d,b))))),IFNA(VSTACK(HSTACK(VSTACK("序号",SEQUENCE(ROWS(r)-1)),r),"",HSTACK("合计","",SUM(DROP(INDEX(r,,2),1)))),""))
格式二
=LET(a,TOCOL(A4:A999,1),a_a,FILTER(a,MOD(SEQUENCE(ROWS(a)),2)=1)&FILTER(a,MOD(SEQUENCE(ROWS(a)),2)=0),r,REDUCE({"姓名","实发金额","管辖地区"},a_a,LAMBDA(x,y,LET(b,TEXTBEFORE(TEXTAFTER(y,".",1),{"大区","地区"}),c,TEXTBEFORE(TEXTAFTER(y,{"大区","地区"}),"(",1),d,--TEXTAFTER(y,{"共计实发:","共计实发"}),VSTACK(x,HSTACK(c,d,b))))),rr,VSTACK(TAKE(r,1),SORT(DROP(r,1),2,-1)),IFNA(VSTACK(HSTACK(VSTACK("序号",SEQUENCE(ROWS(rr)-1)),rr),"",HSTACK("合计","",SUM(DROP(INDEX(rr,,2),1)))),""))
|