参考下面
Excel如何从一段文字中自动提取相关信息
=MAX(IF(COUNTIF(A2,"*区*"),FIND("区",A2),0),IF(COUNTIF(A2,"*县*"),FIND("县",A2),0),IF(COUNTIF(A2,"*知*"),FIND("知",A2),0))
=FIND(1,A2)
=MID(A2,MAX(IF(COUNTIF(A2,"*区*"),FIND("区",A2),0),IF(COUNTIF(A2,"*县*"),FIND("县",A2),0),IF(COUNTIF(A2,"*知*"),FIND("知",A2),0))+1,FIND(1,A2)-MAX(IF(COUNTIF(A2,"*区*"),FIND("区",A2),0),IF(COUNTIF(A2,"*县*"),FIND("县",A2),0),IF(COUNTIF(A2,"*知*"),FIND("知",A2),0))-1)
=IF(ISERROR(MID(A2,IF(ISERROR(IF(ISERROR(FIND("县",A2,1)),FIND("区",A2,1),FIND("县",A2,1))),FIND("知",A2,1),IF(ISERROR(FIND("县",A2,1)),FIND("区",A2,1),FIND("县",A2,1)))+1,FIND("1",A2,1)-IF(ISERROR(IF(ISERROR(FIND("县",A2,1)),FIND("区",A2,1),FIND("县",A2,1))),FIND("知",A2,1),IF(ISERROR(FIND("县",A2,1)),FIND("区",A2,1),FIND("县",A2,1)))-1)),"",MID(A2,IF(ISERROR(IF(ISERROR(FIND("县",A2,1)),FIND("区",A2,1),FIND("县",A2,1))),FIND("知",A2,1),IF(ISERROR(FIND("县",A2,1)),FIND("区",A2,1),FIND("县",A2,1)))+1,FIND("1",A2,1)-IF(ISERROR(IF(ISERROR(FIND("县",A2,1)),FIND("区",A2,1),FIND("县",A2,1))),FIND("知",A2,1),IF(ISERROR(FIND("县",A2,1)),FIND("区",A2,1),FIND("县",A2,1)))-1))
方法之一
假设数据在单元格A1
1、=SUM(IFERROR(FIND({"区","县","知"},A1),0))
ctrl+shift+enter结束输入
2、=FIND("1",A1)
3、=MID(A1,SUM(IFERROR(FIND({"区","县","知"},A1),0))+1,FIND("1",A1)-SUM(IFERROR(FIND({"区","县","知"},A1),0))-1)
ctrl+shift+enter结束输入