ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Padding and Concatenate (https://www.excelbanter.com/excel-discussion-misc-queries/164574-padding-concatenate.html)

Static

Padding and Concatenate
 
Okay I have a collumn of formulas that generate numerical codes.

Because they're codes I need them to retain the 000 padding before them.
I do this by using the custom padding. so excel displays the collumn like...

0000001
0000002
0000003

Now... I need to concatenate these numerical values to the end of a text
code.
so I'm adding say, "code" to the begining of each.

what I want looks like

code.0000001
code.0000002
code.0000003

but when I try to do it, I loose the padding, resulting in

code.1
code.2
code.3

any ideas?

Wigi

Padding and Concatenate
 
If the numbers are in column A, consider:

="code."&Text(A1,"0000000")

--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Static" wrote:

Okay I have a collumn of formulas that generate numerical codes.

Because they're codes I need them to retain the 000 padding before them.
I do this by using the custom padding. so excel displays the collumn like...

0000001
0000002
0000003

Now... I need to concatenate these numerical values to the end of a text
code.
so I'm adding say, "code" to the begining of each.

what I want looks like

code.0000001
code.0000002
code.0000003

but when I try to do it, I loose the padding, resulting in

code.1
code.2
code.3

any ideas?


Static

Padding and Concatenate
 
ah yes, thank you. Thats exactly what I needed.

"Wigi" wrote:

If the numbers are in column A, consider:

="code."&Text(A1,"0000000")

--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Static" wrote:

Okay I have a collumn of formulas that generate numerical codes.

Because they're codes I need them to retain the 000 padding before them.
I do this by using the custom padding. so excel displays the collumn like...

0000001
0000002
0000003

Now... I need to concatenate these numerical values to the end of a text
code.
so I'm adding say, "code" to the begining of each.

what I want looks like

code.0000001
code.0000002
code.0000003

but when I try to do it, I loose the padding, resulting in

code.1
code.2
code.3

any ideas?



All times are GMT +1. The time now is 05:48 AM.

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