fali
fali

Reputation: 57

extract string between last forward slash and first period

I am looking to extract string after the last "/" and first "." in excel using one formula. I tried below and it works how can I combine them into one formula?

get string after last “/”

=MID(A1,FIND("=",SUBSTITUTE(A1,"/","=",LEN(A1)-LEN(SUBSTITUTE(A1,"/",""))))+1,256)

Get string before first “.”

=MID(B1,1,FIND(".",B1)-1)

Upvotes: 0

Views: 1190

Answers (1)

user4039065
user4039065

Reputation:

Try,

=REPLACE(TRIM(RIGHT(SUBSTITUTE(A1, "/", REPT(" ", LEN(A1))), LEN(A1))), FIND(".", TRIM(RIGHT(SUBSTITUTE(A1, "/", REPT(" ", LEN(A1))), LEN(A1)))), LEN(A1), "")

Upvotes: 1

Related Questions