Finding Character Number of the Second "/" in a cell

BigNate

Board Regular
Joined
Dec 17, 2014
Messages
242
Hello Everyone,

Let's say I have column A with cells that have values such as the following:
/USA-UA113256725/AAA542/25

The number of characters will not be the same for all cells in column A
My end goal is to write a formula in B to return "UA113256725" as the result. So I am thinking to myself that I need to do a MID function, find the position of the second "/" (use this for LEN portion of formula) and start with the position of the "-". However, I do not know how to identify the position of the second "/". Can someone please help me?

Thanks in advance for your help.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
To find the 2nd "/" use


=FIND("/",A2,FIND("/",A2)+1)

=MID(A2,FIND("-",A2)+1,FIND("/",A2,FIND("/",A2)+1)-FIND("-",A2)-1) will return UA113256725
 
Last edited:
Upvote 0
You can get the position of the second "/" like this

=FIND("/",A1,FIND("/",A1)+1)
If the single posted example is representative of the data that can appear in cell A1, then this would do...

=FIND("/",A1,2)

and this to get the sought after value...

=MID(A1,FIND("/",A1,2)-11,11)

or, if the dash is universal...

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

Again, assuming that single example is truly representative of the data to be parsed.
 
Last edited:
Upvote 0
I appreciate everyone's input. Thank you very much. This has allowed me to look at this challenge in a new way.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,484
Members
448,967
Latest member
visheshkotha

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