Excel:将每个单词的第一个字符大写

时间:2016-12-06 17:11:05

标签: excel text excel-formula capitalize

我的文字如下:

Your number's up (season 2)

我想将其更改为:

Your Number's Up

但是,我现在使用以下代码获得此信息:

Your Number'S Up

=TRIM(PROPER(IFERROR(LEFT(A6976,FIND("(",A6976)-1),A6976)))

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

使用 A1 中的数据,请使用:

=SUBSTITUTE(PROPER(SUBSTITUTE(A1,"'","zzz")),"zzz","'")

enter image description here

修改#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()功能不会失败。)