finding text between two /

hg090589

New Member
Joined
Sep 18, 2018
Messages
11
Hello,

I have a formula that finds text between the second / and third /

Hello/Waste Sludge Processing/Sludge Pre Conditioning/Sludge Thickening/Thickener Stream/PRIMARY SLUDGE THICKENER

so for this I have:
=TRIM(LEFT(SUBSTITUTE(MID(F6,FIND("|",SUBSTITUTE(F6,"/","|",2))+1,LEN(F6)),"/",REPT(" ",LEN(F6))),LEN(F6)))

Which is fine and displays : Sludge Pre Conditioning

But I have some text strings that are shorter and don't have / in them.is there a way to display those by adding something onto this formula to display ones like this that are shorter instead of it displaying Value?

Hello East SPS
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
See if this does it:

=IF(LEN(F6)>LEN(SUBSTITUTE(F6,"/",""))+1,TRIM(MID(SUBSTITUTE(F6,"/",REPT(" ",99)),99*2,99)),F6)
 
Upvote 0
It checks to see there are 2 slashes in the target cell. If so it gets either whats between the 2nd and 3rd slashes or if only 2 whatever is after the 2nd slash. If less than 2 it just returns the cell value.
 
Upvote 0

Forum statistics

Threads
1,215,052
Messages
6,122,878
Members
449,097
Latest member
dbomb1414

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