Extract data of a cell after colon [duplicate]

天大地大妈咪最大 提交于 2019-12-26 02:45:44

问题


my data looks like this:

Department code
ABCD : ZERT
ABCD : ZERT : TYUI
ABCD : ZERT : TYUI_1
ABCD : ZERT : TYUI_2
ABCD : ZERT : TYOP
ABCD : ZERT : TYOM
ABCD : ZERT : TYOM : WXCV

Basicaly I am looking for a function in excel that will permit me to only extract the last characters placed after the last colon. Expected data would look like this :

Department code            Expected data
ABCD : ZERT                ZERT
ABCD : ZERT : TYUI         TYUI
ABCD : ZERT : TYUI_1       TYUI_1
ABCD : ZERT : TYUI_2       TYUI_2
ABCD : ZERT : TYOP         TYOP
ABCD : ZERT : TYOM         TYOM
ABCD : ZERT : TYOM : WXCV  WXCV

I have tried the function STXT but unfortunatly it is too limited. Anyone have a solution for this ?

Thanks in advance


回答1:


You can use this:

=TRIM(RIGHT(SUBSTITUTE(A1,":",REPT(" ",LEN(A1))),LEN(A1)))

Note: I changed the formula entirely after the first two comments below pointed out the original was incorrect. FYI



来源:https://stackoverflow.com/questions/48688983/extract-data-of-a-cell-after-colon

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