Removing everything after 4th "/"

gyagos

New Member
Joined
Mar 27, 2018
Messages
27
Office Version
  1. 365
Platform
  1. Windows
I've searched and i couldn't find anything relevant to what i am looking to do

i have Path information that i need to trim down so that i only see the first 4 sections after the "/"


Example of a Path within a cel
/aa/prod/bb/LCI/lib/log4j-1.2.16.jar
/aa/test/bb/phxRDS/phxRDSUAT1RuleApp/deploy.05082018/RDS_rule.ear


what i need to have displayed in a new cel
/aa/prod/bb/LCI/
/aa/test/bb/phxRDS/

Thanks in Advance
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
How about
Fluff.xlsm
AB
1
2/aa/prod/bb/LCI/lib/log4j-1.2.16.jar/aa/prod/bb/LCI
3/aa/test/bb/phxRDS/phxRDSUAT1RuleApp/deploy.05082018/RDS_rule.ear/aa/test/bb/phxRDS
Data
Cell Formulas
RangeFormula
B2:B3B2=TEXTBEFORE(A2,"/",5)
 
Upvote 0
Ok, you obviously don't have the new functions yet, try
Excel Formula:
=REPLACE(A2,FIND("^",SUBSTITUTE(A2,"/","^",5))+1,100,"")
 
Upvote 0
Solution
Ok, you obviously don't have the new functions yet, try
Excel Formula:
=REPLACE(A2,FIND("^",SUBSTITUTE(A2,"/","^",5))+1,100,"")
Works like a charm.
Thank you very much for all your support
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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