问题
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