Answers:
试试这个,更新以验证A1中的单元格不是空白并包含(和)字符:
=IF(OR(ISERR(FIND("(",A1)),ISERR(FIND(")",A1)),ISBLANK(A1)),"",SUBSTITUTE(MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1),"-SITE",""))
关闭,SUBSTITUTE是你的朋友 -
=IF(LEN(A1)<>LEN(SUBSTITUTE(A1,"-SITE","")),MID(SUBSTITUTE(A1,"-SITE",""),FIND("(",SUBSTITUTE(A2,"-SITE",""))+1,FIND(")",A1,FIND("(",SUBSTITUTE(A1,"-SITE",""))+1)-1-FIND("(",SUBSTITUTE(A1,"-SITE",""))-5),MID(A1,FIND("(",A1)+1,FIND(")",A1,FIND("(",A1)+1)-1-FIND("(",A1)))
实际上,在最终做到这一点之后,我不再认为SUBSTITUTE是朋友了。上面的答案是SUBSTITUTE比我的好得多的朋友。
IF(LEN(A1)>0, {formula},"")
(etc)中是最简单的。(但如果没有parens,将不会返回任何内容)