extract characters on a string

kbgato

New Member
Joined
Sep 6, 2007
Messages
2
I have strings like the following

06.-.Jekyll.And.Hyde.And.Ted.And.Alice.m0008
06.-.Jekyll.And.Hyde.And.Ted.And.Alice.p09

I would like to extraxt the las characters from the last period (.),
this is; m0008 on the first and p09 on the second.

Can you give me some ideas?

Thanks in advance
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
=TRIM(RIGHT(SUBSTITUTE(A1,".",REPT(" ",LEN(A1))),LEN(A1)))
 
Upvote 0
Are the number of periods always the same? If so,

1)use SUBSTITUTE to change the nth period to a CHAR(5)
2)use FIND to find the location of CHAR(5) in the changed string
3)use MID to chop off everything after that point.

If the number of periods varies.

=Len(string)-Len(SUBSTITUTE(string,"",".") will give you the number of periods. From which you can use steps 1-3
 
Upvote 0
Thanks Hotpeper it was grate.
Thanks mikerickson, I made a little change on your answer and it works fine.
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,704
Members
449,048
Latest member
81jamesacct

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