reading the 5 characters after the LAST "/" in a t

Sethrow

New Member
Joined
Nov 15, 2005
Messages
10
Ok this should be really easy (I think!) but can't get it to work! All I want to be able to do is have one column with data like the stuff below and the next colum to contain the 5 numbers (ie 42055 or 45433) that occur after the last "/" (not always the 3rd).

Anyone got any ideas?

Sample data:
October ABC/Standard Input 100x200/Random/42055
October ABC/Standard Input 100x200/Random/42055 tag 2
December AAA/Fixed Input 100x300/Fixed/45433

Many thanks,

Seth
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Re: reading the 5 characters after the LAST "/" in

Sethrow said:
Ok this should be really easy (I think!) but can't get it to work! All I want to be able to do is have one column with data like the stuff below and the next colum to contain the 5 numbers (ie 42055 or 45433) that occur after the last "/" (not always the 3rd).

Anyone got any ideas?

Sample data:
October ABC/Standard Input 100x200/Random/42055
October ABC/Standard Input 100x200/Random/42055 tag 2
December AAA/Fixed Input 100x300/Fixed/45433

Many thanks,

Seth

Either:

=REPLACE(A2,1,SEARCH(CHAR(127),SUBSTITUTE(A2,"/",CHAR(127),LEN(A2)-LEN(SUBSTITUTE(A2,"/","")))),"")

Or, with the morefunc.xll add-in installed:

=WMID(A2,WORDCOUNT(A2,"/"),1,"/")
 
Upvote 0
Good work

Good work although I had to change it slightly as it had everything after the last / not just the 5 numbers this works though:

=LEFT(REPLACE(A2,1,SEARCH(CHAR(127),SUBSTITUTE(A2,"/",CHAR(127),LEN(A2)-LEN(SUBSTITUTE(A2,"/","")))),""),5)

Can't use the nicer add in as its work computers and it needs to work on anyones computer and I cant really go installing that on everyones computer! Thanks again

Seth
 
Upvote 0
Re: Good work

Sethrow said:
Good work although I had to change it slightly as it had everything after the last / not just the 5 numbers this works though:

=LEFT(REPLACE(A2,1,SEARCH(CHAR(127),SUBSTITUTE(A2,"/",CHAR(127),LEN(A2)-LEN(SUBSTITUTE(A2,"/","")))),""),5)

Can't use the nicer add in as its work computers and it needs to work on anyones computer and I cant really go installing that on everyones computer! Thanks again

Seth

Morefunc has an option to include itself into the workbook you want to distribute under Tools|Morefunc when installed.
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,209
Members
448,874
Latest member
b1step2far

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