wkxxxr 发表于 2023-3-11 13:07
这个是根据每行人数依次排下的结果
不理解为什么要空一个座位,写了一个365的函数,m是一排中间座位的个数,s是左边或者右边的座位个数
=LET(m,5,s,5,data,A2:B34,peo,FILTER(INDEX(data,,1),INDEX(data,,2)=""),n,ROWS(peo),mSer,SEQUENCE(m,,INT(m/2)*2,-2),aSer,VSTACK(SEQUENCE(s,,m+s,-1),IF(mSer>0,mSer,ABS(mSer)+1),SEQUENCE(s,,m+s+1)),expn,ROUNDUP(n/(m+s),0),peoSer,SEQUENCE(,expn,0,m+s*2)+CHOOSECOLS(aSer,SEQUENCE(expn,,,0)),name,TRANSPOSE(IFERROR(INDEX(peo,peoSer),"")),split,HSTACK(EXPAND(TAKE(name,,s),,s+1,""),EXPAND(DROP(TAKE(name,,m+s),,s),,m+1,""),TAKE(name,,-s)),split) |