Extracting text before ~ sign



Hi Everyone,

Please help me with your expertise. I have this type of data
(12345~Sample), that series is a code followed by the code name. Now I
want to get only the code after the ~ sign, my problem is the code is
not fix, some codes consist of 3 characters only so I cannot just use
the simple left(A1,#) formula.

Thanks in advance!


Rick Rothstein \(MVP - VB\)

Your subject says you want the text before the sign and your message says
the text after the sign; so, here is both...

Before: =LEFT(A1,FIND("~",A1&"~")-1)

After: =MID(A1,FIND("~",A1&"~")+1,999)



Thanks Mike for the reply. I've tried your formula and I am getting
the account name's from my data, is there a way to change this formula
so I can get the code only from my file? Many thanks in advance!!

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