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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,601
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,303
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,141,204
Messages
5,704,954
Members
421,372
Latest member
Jamie11

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