How to concatenate to get specific format

krodriguez

Board Regular
Joined
Jul 11, 2012
Messages
119
Any ideas on how to do this?
these are the values I have on these cells:
A1=7100 B1=5 C1=2 D1=0 E1=0 F1=0

In cell G1 above needs to look in this format
7100-05-10-00-000- 0000

<tbody>
</tbody>

Thanks,
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Code:
=TEXT(A1,"0000") & "-" & TEXT(B1,"00") & "-" & TEXT(C1,"00") & "-" & TEXT(D1,"00") & "-" & TEXT(E1,"0000") & "-" & TEXT(F1,"0000")
Though, I think you may have a typo with C1 (if C1=2, how does that translate to "00"?)
 
Upvote 0
You can try this

=CONCATENATE(A1, L1, "0",B1, L1, "0",C1, L1, "00",D1,L1, "0",E1,"0", F1)

L1 is where I placed the Dash -
 
Upvote 0
Use this one its better than the last one

=CONCATENATE(A3, "-", "0",B3, "-", "0",C3, "-", "00",D3,"-", "0",E3,"0", F3)

the Dash is in the consatente
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,816
Members
449,469
Latest member
Kingwi11y

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