Sorry I'm a noob in excel and need help with this. Say I have the following text in my excel.
- D:/folder A/ folder B.1/text_01.txt
- D:/folder A/Folder C/ folder C.1/text_02.msg
I like to remove all the text from the right after the first occurrence "/" counting from the right.
So I would get the followings.
- D:/folder A/ folder B.1
- D:/folder A/Folder C/ folder C.1
Use LEFT() with FIND and SUBSTITUTE to find the last
/
If you don't mind a bit of vba, then
InStrRev
was almost tailor made for cases like these:If you have Excel 2016+ with the
TEXTJOIN
function, you can use this array formula:Since this is an array formula, you need to "confirm" it by holding down ctrl + shift while hitting enter. If you do this correctly, Excel will place braces
{...}
around the formula as observed in the formula bar