我有一系列(列)数字
A
1 1209999
2 158999
3 1329999
4 139999
我想删除单元格末尾的所有 9,所以数字 1209999 将是 120,而数字 158999 将是 158,这可能吗?
最佳答案
如果您需要从单元格中删除所有“9”,请使用 =SUBSTITUTE(A1,"9","")
如果您只需要删除字符串末尾的“9”,请使用这个小 UDF:
Function DelEnd9(x As String)
DelEnd9 = x
If Len(x) = 0 Then Exit Function
If Right(x, 1) <> "9" Then Exit Function
DelEnd9 = DelEnd9(Left(x, Len(x) - 1))
End Function
并这样称呼它:
=DelEnd9(A1)
关于excel - 删除excel单元格中的一些数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22591694/