concatenate a text value

jordanburch

Active Member
Joined
Jun 10, 2016
Messages
440
Office Version
  1. 2016
Hey all,

I have a column of data that is as such
0004354
0034567
5678
4

I need them to be 7 digits with leading 0s IE
0000004

I did the text function but then I need to concatenate it or add a " before and after the number

concatenate(""",A4,"""")

the A4 inside the concatenate only returns "A4" when I want it to return "0000004"

any ideas?

Jordan
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Concatenate will combine the actual value of the entry (what you see in the cell editor), not the formatted value.
If you want to maintain the leading zeroes which are only visible because of custom formatting, you need to use the Text function like this:
Excel Formula:
=concatenate(""",TEXT(A4,"0000000"),"""")
 
Upvote 0
Concatenate will combine the actual value of the entry (what you see in the cell editor), not the formatted value.
If you want to maintain the leading zeroes which are only visible because of custom formatting, you need to use the Text function like this:
Excel Formula:
=concatenate(""",TEXT(A4,"0000000"),"""")
thanks for your help. For whatever reason when I click enter it just selects the "0000000" portion and does not allow the formula. Im not sure how to fix that

Jordan
 
Upvote 0
It looks like there may be an error/typo in the original formula you posted, and I copied that.
It appears that you do not have the correct number of " somewhere.
Fix that, and just insert TEXT(A4,"0000000") where you have A4 and I think it should work.
 
Upvote 0
Another option getting rid of all the """" is
Excel Formula:
=CHAR(34)&TEXT(A4,"0000000")&CHAR(34)
 
Upvote 0
Solution
It looks like there may be an error/typo in the original formula you posted, and I copied that.
It appears that you do not have the correct number of " somewhere.
Fix that, and just insert TEXT(A4,"0000000") where you have A4 and I think it should work.
thanks Joe! looks like i got all the TITANS of the board helping me today!

Jordan
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,200
Members
449,072
Latest member
DW Draft

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