How to get rest of characters after last certain character?

W

Wille

Hi All,


e.g. In cell A1 there is a string = "dummy1\dummy3\cat\test"

In cell B1 I want result = "test"

In pseudo code:

test = functionX("dummy1\dummy3\cat\test"; "\" )

I don't want write visual basic code just use normal excel functions.

Is it possible to write this kind of function?
 
J

joel

Use INSTRREV

string = "dummy1\dummy3\cat\test"
string = mid(string,instrrev(string,"\") + 1)

The instrrev will find the position of the last back slash in th
string. You add one to get everything after the last back slash
 
R

Ron Rosenfeld

Hi All,


e.g. In cell A1 there is a string = "dummy1\dummy3\cat\test"

In cell B1 I want result = "test"

In pseudo code:

test = functionX("dummy1\dummy3\cat\test"; "\" )

I don't want write visual basic code just use normal excel functions.

Is it possible to write this kind of function?

=TRIM(RIGHT(SUBSTITUTE(A1,"\",REPT(" ",99)),99))

--ron
 
Top