Return texts between certain characters from a long string (de-concatenate)

regresss

Board Regular
Joined
May 20, 2015
Messages
68
Hi, I have a string which goes //John/McCormik/25

The slash is used to divide the string into a few parts. Now I would like to return them, i.e. to de-concatenate and retrieve:

*nothing ("") for the first position,
*"John" for the second position,
*"McCormick" for the third position, and
*"25" for the fourth position.
 
Last edited:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Use the Data Tab and Text to Columns step through and use the / as the separator
 
Upvote 0
I need to use a formula for this. I was thinking about something like

*MID(cell,position of the 1st slash, position of the 2nd slash)
*MID(cell,position of the 2nd slash, position of the 3rd slash)
*MID(cell,position of the 3rd slash, position of the 4th slash)
*MID(cell,position of the 4th slash, position of the 5th slash)

But it's difficult to retrieve position of slashes.
 
Upvote 0
Ï have found a solution

A1: //John/McCormick/25
=MID(A1,FIND(CHAR(120),SUBSTITUTE(F3,"/",CHAR(120),1))+1,FIND(CHAR(120),SUBSTITUTE(F3,"/",CHAR(120),24))-FIND(CHAR(120),SUBSTITUTE(F3,"/",CHAR(120),1))-1)
=MID(A1,FIND(CHAR(120),SUBSTITUTE(F3,"/",CHAR(120),2))+1,FIND(CHAR(120),SUBSTITUTE(F3,"/",CHAR(120),3))-FIND(CHAR(120),SUBSTITUTE(F3,"/",CHAR(120),2))-1)
=MID(A1,FIND(CHAR(120),SUBSTITUTE(F3,"/",CHAR(120),3))+1,FIND(CHAR(120),SUBSTITUTE(F3,"/",CHAR(120),4))-FIND(CHAR(120),SUBSTITUTE(F3,"/",CHAR(120),3))-1)
 
Upvote 0

Forum statistics

Threads
1,203,317
Messages
6,054,711
Members
444,742
Latest member
jmartin9247

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