Concatenating but keeping the leading zeros

Formulation

New Member
Joined
Aug 26, 2016
Messages
25
I'm trying to concatenate several columns, one of which contains leading zeros in some of the cells.

Example below: Row two is correct (PN # Column)
Row 1 is not bringing over the "00" in "003"
I have the length column set to display as 003 but concatenate is removing the two 0's.


[TABLE="width: 650"]
<tbody>[TR]
[TD]PN #[/TD]
[TD]Length[/TD]
[TD]Feet[/TD]
[TD]Other Parts[/TD]
[/TR]
[TR]
[TD][TABLE="width: 215"]
<tbody>[TR]
[TD="width: 215"]C1-LCLCBD3OM2APLDC3M[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]003[/TD]
[TD]M[/TD]
[TD]C1-LCLCBD3OM2APLDC[/TD]
[/TR]
[TR]
[TD][TABLE="width: 215"]
<tbody>[TR]
[TD="width: 215"]C1-LCLCBD3OM2APLDC270F[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]270[/TD]
[TD]F[/TD]
[TD][TABLE="width: 215"]
<tbody>[TR]
[TD="width: 215"]C1-LCLCBD3OM2APLDC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
If 003 is in cell B2, you can try something like

Code:
=CONCATENATE(A2;TEXT(B2;"000"))

Thanks. My original formula is:
Code:
=CONCATENATE(F7, "-",K7,M7,AA7,Q7,O7,W7,U7,Y7,I7,H7)
I7 in the formula = 003
Sometimes it may be 012, which is also only displaying as 12 after concatenating.

How would I use your code but include the other cells including the dash(-) after F7?


I've tried a few methods I found on google but they either won't work or are related to adding a static number of 0's as a prefix.
 
Last edited:
Upvote 0
I tried something new and it seems to be working. I suppose I'll use this unless someone has a reason why I shouldn't.
Code:
=CONCATENATE(F8, "-",K8,M8,AA8,Q8,O8,W8,U8,Y8,[B]TEXT(I8,"0##")[/B],H8)
It's concatenating 001, 011, and 111 correctly.
 
Upvote 0
Actually ended up using something similar to your formula and it worked. Thanks
Code:
=CONCATENATE(F7, "-",K7,M7,AA7,Q7,O7,W7,U7,Y7,TEXT(I7,"000"),H7)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top