=MID(A1,SMALL(IF(((--(CODE(MID(A1,ROW(INDIRECT("$1:"&LEN(A1))),1))>64))+(--(CODE(MID(A1,ROW(INDIRECT("$1:"&LEN(A1))),1))<123)))=2,ROW(INDIRECT("$1:"&LEN(A1))),""),1),LARGE(IF(((--(CODE(MID(A1,ROW(INDIRECT("$1:"&LEN(A1))),1))>64))+(--(CODE(MID(A1,ROW(INDIRECT("$1:"&LEN(A1))),1))<123)))=2,ROW(INDIRECT("$1:"&LEN(A1))),""),1)-SMALL(IF(((--(CODE(MID(A1,ROW(INDIRECT("$1:"&LEN(A1))),1))>64))+(--(CODE(MID(A1,ROW(INDIRECT("$1:"&LEN(A1))),1))<123)))=2,ROW(INDIRECT("$1:"&LEN(A1))),""),1)+1)
按CTRL+SHIFT+ENTER三键结束
只适用单元格字符串中的字母是连续的,不连续就没用。
假设数据在A1,B1输入:
=MIDB(A1,SEARCHB("?",A1),MIN(FINDB(ROW($1:$10)-1,A1&5/19))-SEARCHB("?",A1))
数组公式,公式输完后或复制进去后,不要按ENTER,要按CTRL+SHIFT+ENTER三键结束。
下拉填充即可。
=REPLACE(A1,FIND(LOOKUP(9E+307,--RIGHT(A1,ROW(A1:A100))),A1,1),100,"")