How to Insert Dashes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello:

In various cells, I have such data as "1000001p" How can I have Excel
automatically change it to "1000-001P" or even "1000-001-P"?

You see, I need dashes inserted and I need the last alpha character to be
capitalized.

Thanks!

childofthe1980s
 
Hi,
Assuming data in A1, put the following in B1:

=TEXT(LEFT(A1,LEN(A1)-1),"0000-000-") & UPPER(RIGHT(A1,1))

Change the "0000-000-" to suit your needs.

HTH
 
Here is a formula. It assumes that 10000001p is in Cell A1

=LEFT(A1,5)&"-"&MID(A1,6,3)&"-"&UPPER(RIGHT(A1,1))
 

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

Back
Top