Excel 2002: How to extract characters ?

M

Mr. Low

Dear Sir,

I wish to extract the last 6 characters if a cell in column A has 13
characters, otherwise only extract the last 3 characters.

Illustration:

A B
1 510104BGH9006 BGH9006
2 510104TRL TRL
3 510104OTH9016 OTH9016
4 510202HLG HLG
5 510104KJY9018 KJY9018
6 510203FTP FTP
7 510104IPL9023 IPL9023
8 510209SGS SGS

May I know what formula must input at cell B1 and copy downwards to get the
answer ?

Thanks

Low
 
M

Mike H

Hi,

I've assumed you mean >= 13 but if I'm incorrect in that assumption use the
second version. the formula can be dragged

=IF(LEN(A1)>=13,RIGHT(A1,6),RIGHT(A1,3))
=IF(LEN(A1)=13,RIGHT(A1,6),RIGHT(A1,3))

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top