Excel:将每个单词的首字母大写
我以下文字:
Your number's up (season 2)
我想把它改成:
Your Number's Up
不过,我现在用下面的代码得到这个:
Your Number'S Up =TRIM(PROPER(IFERROR(LEFT(A6976,FIND("(",A6976)-1),A6976)))
我怎样才能解决这个问题?
使用A1中的数据,使用:
=SUBSTITUTE(PROPER(SUBSTITUTE(A1,"'","zzz")),"zzz","'")
编辑#1:
请删除括号内的部分,使用:
=MID(SUBSTITUTE(PROPER(SUBSTITUTE(A1,"'","zzz")),"zzz","'"),1,FIND("(",SUBSTITUTE(PROPER(SUBSTITUTE(A1,"'","zzz")),"zzz","'"))-1)
编辑#2:
看看这是否更好:
=MID(SUBSTITUTE(PROPER(SUBSTITUTE(A1,"'","zzz")),"zzz","'"),1,FIND("(",SUBSTITUTE(PROPER(SUBSTITUTE(A1,"'","zzz")),"zzz","'") & "(")-1)
(诀窍是确保FIND()
函数不会失败。)