ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to Insert Dashes (https://www.excelbanter.com/excel-programming/330028-how-insert-dashes.html)

childofthe1980s

How to Insert Dashes
 
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

Don Guillett[_4_]

How to Insert Dashes
 
Have a look in HELP index for MID

--
Don Guillett
SalesAid Software

"childofthe1980s" wrote in
message ...
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




Toppers

How to Insert Dashes
 
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


"childofthe1980s" wrote:

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


Jim Thomlinson[_4_]

How to Insert Dashes
 
Here is a formula. It assumes that 10000001p is in Cell A1

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

--
HTH...

Jim Thomlinson


"childofthe1980s" wrote:

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



All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com