我有这个字符串:
Category1 > SubCategory11 > SubSubCategory111 > Something
Category2 > SubCategory21 > SomethingElse
Category3 > SubCategory31 > SubSubCategory32 > SubSubSubCategory33 > AnotherSomethingElse
Category4 > Else
如何删除最后一个“>”之后的所有内容?
提前致谢。
答案 0 :(得分:2)
公式方法:
=LEFT(A1, FIND("|", SUBSTITUTE(A1, ">", "|", LEN(A1)-LEN(SUBSTITUTE(A1, ">", "")))))
摆脱>太:
=TRIM(LEFT(A1, FIND("|", SUBSTITUTE(A1, ">", "|", LEN(A1)-LEN(SUBSTITUTE(A1, ">", ""))))-1))