本帖最后由 橒♂蝣 于 2023-4-30 07:51 编辑
想了一个新思路:B4=LET(求和列,FILTER(SUMIFS(表2!G2:G53,表2!K2:K53,表2!K2:K53,表2!E2:E53,表2!$E$2,表2!F2:F53,表2!$F$3,表2!I2:I53,">=5",表2!I2:I53,"<=12.9",表2!L2:L53,表2!L2:L53),(表2!L2:L53=表2!$L$35)*(表2!E2:E53=表2!$E$2)*(表2!F2:F53=表2!$F$3)*(表2!I2:I53>=5)*(表2!I2:I53<=12.9)),
计数列,FILTER(COUNTIFS(表2!L2:L53,表2!L2:L53,表2!K2:K53,表2!K2:K53,表2!E2:E53,表2!$E$2,表2!F2:F53,表2!$F$3,表2!I2:I53,">=5",表2!I2:I53,"<=12.9"),(表2!L2:L53=表2!$L$35)*(表2!E2:E53=表2!$E$2)*(表2!F2:F53=表2!$F$3)*(表2!I2:I53>=5)*(表2!I2:I53<=12.9)),
原始,FILTER(表2!A2:L53,(表2!L2:L53=表2!$L$35)*(表2!E2:E53=表2!$E$2)*(表2!F2:F53=表2!$F$3)*(表2!I2:I53>=5)*(表2!I2:I53<=12.9)),
条件1,SORTBY(原始,计数列,-1,求和列,-1,INDEX(原始,,7),-1),
前端1,FILTER(条件1,INDEX(条件1,,11)=INDEX(UNIQUE(INDEX(条件1,,11)),1)),
前端2,FILTER(条件1,INDEX(条件1,,11)=INDEX(UNIQUE(INDEX(条件1,,11)),2)),
商家位置1,SMALL(UNIQUE(XMATCH(INDEX(前端1,,4),INDEX(前端1,,4))),SEQUENCE(2)),
日1,INDEX(INDEX(前端1,,7),商家位置1),
商家位置2,SMALL(UNIQUE(XMATCH(INDEX(前端2,,4),INDEX(前端2,,4))),SEQUENCE(2)),
日2,INDEX(INDEX(前端2,,7),商家位置2),
FILTER(条件1,ISNUMBER(XMATCH(INDEX(条件1,,7),日1))+ISNUMBER(XMATCH(INDEX(条件1,,7),日2)))) |