First of all, your question will be better at superuser.com .
You can use LEFT , with FIND and SUBSTITUTE ... and a couple more others:
=LEFT(A1, FIND(CHAR(1), SUBSTITUTE(A1, "\", CHAR(1), LEN(A1)-LEN(SUBSTITUTE(A1, "\", ""))))-1)
LEN(A1)-LEN(SUBSTITUTE(A1, "\", "") basically gives the number \ in the string.
SUBSTITUTE(A1, "\", CHAR(1), LEN(A1)-LEN(SUBSTITUTE(A1, "\", "")) This part will replace the last \ with a character named CHAR(1) .
Then use FIND to get the position of this character and minus 1 to remove the found position of the character, so that LEFT (both figuratively and literally) with the part that you need.
If you need the last backslash, remove -1 .
Jerry source share