find the 2nd | and the 3rd | in a string and extract any data in between

jordanburch

Active Member
Joined
Jun 10, 2016
Messages
440
Office Version
  1. 2016
hey guys I have the following

=MID(LEFT(B2,FIND("|",B2)+2),FIND("|",B2)+1,LEN(B2))

I have the data

| ---Johnny walker | 4264345sw 18th aven, #3, miami, OH 33135 | No | No

Im trying to find the address in between the second | and the third | and I cant get the sytax right. Any help is appreciated!

Jordan
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
How about
Excel Formula:
=TRIM(MID(SUBSTITUTE(B2,"|",REPT(" ",100)),200,100))
 
Upvote 0
Solution
Glad to help & thanks for the feedback.
 
Upvote 0
So if I wanted to change it to the 2 nd and 3rd instance would I just change the 200 to 300 and the 100 to 200?
 
Upvote 0
You are asking for two values to be returned, correct? If so, we need to know if any of the values could possibly have a space character in them.
 
Upvote 0
You are asking for two values to be returned, correct? If so, we need to know if any of the values could possibly have a space character in them.
I'm wanting the text in-between the | value. So basically if I wanted the text in-between the third and fourth and so on and so on. Fluffs formula works for text between the second and third | but I want to be able to modify it for the third and fourth |. Hopefully that makes sense e
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,913
Members
449,093
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