Combine cells in specific format

spectraflame

Well-known Member
Joined
Dec 18, 2002
Messages
821
Office Version
  1. 365
Platform
  1. Windows
I have the follow columns of numbers. I need to combine them in a specific format like ###-######-##. How would I go about doing this? In the case where there is only a single number like column c or 5 numbers like column D, a "0" would be the leading number.
Incode Customers 11-16-05.xls
ABCD
220100483
380301340
4160404241
5160404241
6160404540
7160404540
8160404540
9160404750
10170500226
11170500226
12180503773
13180503773
14300902918
153009029698
16300903022
17300903073
1833010029598
Sheet1
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
63,302
Office Version
  1. 365
Platform
  1. Windows
Do you mean a formula like this (for row 2):
=TEXT(A2,"000")&"-"&TEXT(B2,"000000")&"-"&TEXT(C2,"00")
 

spectraflame

Well-known Member
Joined
Dec 18, 2002
Messages
821
Office Version
  1. 365
Platform
  1. Windows
That is exactly what I was looking for.

Thanks for the quick response.

Matthew
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,999
Messages
5,834,813
Members
430,323
Latest member
Regash

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
Top