Find a portion of text

itsgrady

Board Regular
Joined
Sep 11, 2022
Messages
115
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
I need to pull the text nested between the 5th and 6th "/" in a long string of text, I tried the following formula:

=MID(A1, FIND("/", A1, FIND("/", A1, FIND("/", A1, FIND("/", A1) + 1) + 1) + 1) + 1, FIND("/", A1, FIND("/", A1, FIND("/", A1, FIND("/", A1, FIND("/", A1) + 1) + 1) + 1) + 1) + 1) - FIND("/", A1, FIND("/", A1, FIND("/", A1) + 1) + 1) - 1)

It is not pulling the portion of the text I need. Is there a simpler formula?

Thanks for any help.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
You could try:

Excel Formula:
=FILTERXML("<a><b>"&SUBSTITUTE(A1,"/","</b><b>")&"</b></a>","//b[6]")
 
Upvote 0
Some of the numbers pulling have a leading zero. Is there a way I can add a ‘ before the number to show the leading zero?
 
Upvote 0
Are they a fixed length?
 
Upvote 0
Then you can wrap the whole thing in a TEXT function:

Excel Formula:
=TEXT(FILTERXML("<a><b>"&SUBSTITUTE(A1,"/","</b><b>")&"</b></a>","//b[6]"),"000000")
 
Upvote 0

Forum statistics

Threads
1,215,261
Messages
6,123,949
Members
449,134
Latest member
NickWBA

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