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
 

Some videos you may like

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
=TRIM(RIGHT(SUBSTITUTE(A1,".",REPT(" ",LEN(A1))),LEN(A1)))
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,917
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
 

kbgato

New Member
Joined
Sep 6, 2007
Messages
2
Thanks Hotpeper it was grate.
Thanks mikerickson, I made a little change on your answer and it works fine.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,144
Messages
5,599,978
Members
414,354
Latest member
Flaxarn

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
Top