Isolate string from filepath

howster1976

New Member
Joined
Jan 12, 2023
Messages
6
Office Version
  1. 2019
Platform
  1. MacOS
Hi,
Let's say I have 4 rows in Column A (titled filepaths) with the following filepath content:

A1: /page1/page2/page3
A2: /page4/page5
A3: /page6/page7/page8/page9
A4: /page10
...
A300 .....

...I need a formula to isolate the parent of the last child into eg the corresponding column B (titled parent), so:

B1 would derive a value of page2
B2 would derive a value of page4
B3 would derive a value of page8
B4 would derive a value of [blank] as it has no parent

Can anyone suggest a formula please that could achieve this?

Thanks
 
You're welcome. Thanks for the follow-up. :)

.. and for updating your details. (y)

@Georgiboy BTW, if TEXTSPLIT was available this would be another option
Excel Formula:
=LET(ts,TEXTSPLIT(A1,,"/"),INDEX(ts,ROWS(ts)-1))
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top