LinkedIn Post by:
Rick Rothstein
=FILTER(A2:A8,MAP(A2:A8,LAMBDA(a,a=0+CONCAT(MID(a,SEQUENCE(,LEN(a),LEN(a),-1),1))*ISERR(TEXTSPLIT(a,{0,1,8},,1)))))
=FILTER(A2:A8,MAP(A2:A8,LAMBDA(a,a=0+CONCAT(MID(a,SEQUENCE(,LEN(a),LEN(a),-1),1))*ISERR(TEXTSPLIT(a,{0,1,8},,1)))))
=FILTER(A2:A8,MAP(A2:A8,LAMBDA(x,IF(AND(--CONCAT(MID(x,SEQUENCE(LEN(x),,LEN(x),-1),1))=x,CONCAT(IFERROR(FIND({"2","3","4","5","6","7","9"},x),""))=""),1,0))))
=LET(a,MAP(A2:A8,LAMBDA(n,LET(
x, MID(n, SEQUENCE(LEN(n)), 1) + 0,
r, SORTBY(x, SEQUENCE(COUNTA(x), , , -1)),
e, IFERROR(SUM(FILTER(x, ((x <> 1) * (x <> 0) * (x <> 8)))), 0),
s, TEXTJOIN("", , IF(AND(r = x, e = 0), x, 0)),
s+0
))),FILTER(a,a<>0))
=LET(_n,A2:A8,FILTER(_n,MAP(_n,LAMBDA(a,LET(_l,LEN(a),_m,MID(a,SEQUENCE(_l),1),AND(_m=CHOOSEROWS(_m,SEQUENCE(_l,,_l,-1)),ISNUMBER(XMATCH(--_m,{0;1;8}))))))))
=LET(w;MAP(A2:A8;LAMBDA(q;LET(x;VALUE(MID(q;LEN(q)-SEQUENCE(LEN(q))+1;1));y;VALUE(MID(q;SEQUENCE(LEN(q));1));IF(AND(x=y;COUNT(FILTER(y;((y=1)+(y=0)+(y=8))))=COUNT(x));q;0))));FILTER(w;w<>0))
=FILTER(A2:A8,MAP(A2:A8,LAMBDA(a,LET(f,LAMBDA(b,c,SUBSTITUTE(b,c,"")),AND(f(f(f(a,0),1),8)="",a=--CONCAT(MID(a,SEQUENCE(15,,15,-1),1)))))))
or
=LET(a,A2:A8,FILTER(a,ISERROR(TEXTSPLIT(a,{"0";"1";"8"},,1))*(a=--TEXTSPLIT(CONCAT(MID("|"&a,SEQUENCE(,15,15,-1),1)),,"|",1))))