硬怼~~~~~~~~~~~~~~·
=LET(d,LET(c,FILTER(LET(a,HSTACK(IF(ISNUMBER(FIND("单位名称:",TAKE(VSTACK(B3:H849),,1))),CHOOSECOLS(VSTACK(B3:H849),2,6),""),VSTACK(B3:H849)),HSTACK(SCAN(,TAKE(a,,1),LAMBDA(x,y,IF(y<>"",y,x))),SCAN(,CHOOSECOLS(a,2),LAMBDA(x,y,IF(y<>"",y,x))),VSTACK(B3:H849))),NOT(BYROW(N(ISNUMBER(FIND({"单位名称:","名 称","合计:","备注:","兴城鹿角北路18号五金市场3栋1738369098","收货人:","兴城凯威","发 货 单"},CHOOSECOLS(LET(a,HSTACK(IF(ISNUMBER(FIND("单位名称:",TAKE(VSTACK(B3:H849),,1))),CHOOSECOLS(VSTACK(B3:H849),2,6),""),VSTACK(B3:H849)),HSTACK(SCAN(,TAKE(a,,1),LAMBDA(x,y,IF(y<>"",y,x))),SCAN(,CHOOSECOLS(a,2),LAMBDA(x,y,IF(y<>"",y,x))),VSTACK(B3:H849))),3)))),LAMBDA(b,SUM(b))))),FILTER(c,CHOOSECOLS(c,3)<>0)),GROUPBY(CHOOSECOLS(d,2,1,3),CHOOSECOLS(d,8),SUM))
|