How to delete Certain Characters in a excel 2010 cell

旧巷老猫 提交于 2019-12-03 15:59:43

问题


In column A I have a load of name that look like this

[John Smith]

I still want them in A but the [] removed...


回答1:


If [John Smith] is in cell A1, then use this formula to do what you want:

=SUBSTITUTE(SUBSTITUTE(A1, "[", ""), "]", "")

The inner SUBSTITUTE replaces all instances of "[" with "" and returns a new string, then the other SUBSTITUTE replaces all instances of "]" with "" and returns the final result.




回答2:


Replace [ with nothing, then ] with nothing.




回答3:


Another option: =MID(A1,2,LEN(A1)-2)

Or this (for fun): =RIGHT(LEFT(A1,LEN(A1)-1),LEN(LEFT(A1,LEN(A1)-1))-1)



来源:https://stackoverflow.com/questions/17652349/how-to-delete-certain-characters-in-a-excel-2010-cell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!