Concatenate 2 cells and separate with 2 hyphens

bristolrob

New Member
Joined
Apr 23, 2018
Messages
28
Ok my friends, i have searched for concatenating 2 cells with hyphens and have found several solutions.
I cannot however see what it is that i am after.
I would like to concatenate 2 values e.g 2453 in cell 1 and 987654321 in cell 2.
I have seen how to do the first hyphen using =CONCATENATE(A1,"-",A2)
I need to put a hyphen between the 2 values and then also hyphens between the first 2 & the next 3 of the second value as so,
2543-98-765-4321.
Your help is always appreciated.
Rob
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,516
Office Version
  1. 365
Platform
  1. Windows
You can do this:

=TEXT(A1&B1,"0000-00-000-0000")
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
If you have the first value in A1 and the second in B1 try this.

=A1 &"-" & LEFT(B1,2) & "-" & MID(B1,3,3) & "-" & MID(B1,6,4)
 

Forum statistics

Threads
1,136,314
Messages
5,675,018
Members
419,543
Latest member
Casp

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