本帖最后由 咔咔乱坠 于 2024-7-23 19:01 编辑
描述:答案在题干下方,题目开头是阿拉伯数字,选项固定为A-D
来源:https://club.excelhome.net/threa ... tml?_dsign=7eb820be
解法1
- =LET(c,A:A,a,T(OFFSET(A1,ROW(1:5)*6-6,)),b,INDEX(c,MATCH(a,c,)+5),HSTACK(a,MAP(a,b,LAMBDA(x,y,LET(z,OFFSET(c,MAX((LEFT(x)=LEFT(c))*ROW(c)),,4),TEXTJOIN("+",,IF(ISERR(FIND(LEFT(z),y)),"",z)))))))
复制代码 解法2,更通用
- =DROP(REDUCE(0,A1:A30,LAMBDA(x,y,IF(LEFT(y)<="9",VSTACK(x,IF({1,0},y,LET(选项,OFFSET(y,,,5),答案,OFFSET(y,5,),TEXTJOIN("+",,VLOOKUP(MID(答案,SEQUENCE(LEN(答案)),1)&"*",选项,1,0))))),x))),1)
复制代码 阿武教程
- =LET(s,WRAPROWS(A1:A30,6),r,DROP(s,,-1),HSTACK(TAKE(s,,1),BYROW(REPT(r,REGEXTEST(TAKE(s,,-1),LEFT(r))),LAMBDA(x,TEXTJOIN("+",,x)))))
复制代码 渣渣
- =DROP(REDUCE("",A1:A30,LAMBDA(x,z,IF(MOD(ROW(z),6)=1,VSTACK(x,HSTACK(z,TEXTJOIN("+",,FILTER(OFFSET(z,1,,4),ISNUMBER(FIND(LEFT(OFFSET(z,1,,4)),OFFSET(z,5,))))))),x))),1)
复制代码 凤凰涅槃
- =LET(s,WRAPROWS(A1:A30,6),t,DROP(s,,1),HSTACK(TAKE(s,,1),BYROW(IF(REGEXTEST(t,"["&TAKE(s,,-1)&"].{2,"),t,""),LAMBDA(x,TEXTJOIN("+",,x)))))
复制代码
|