How to Concatenate Two Columns in Excel with Hyphen: 9 Quick Methods

Method 1 – Using the CONCATENATE Function to Concatenate Two Columns with a Hyphen

Steps:
➤ Use the following formula in cell D4.

=CONCATENATE(B4,"-",C4)

B4 is the Product Apple, C4 is the State of Delivery Delivered, and “-” is the separator between them.

CONCATENATE function

➤ Press ENTER and drag down the Fill Handle tool.

CONCATENATE function

Result:
We concatenated the products in the Product column and the delivery states in the State of Delivery column with a hyphen as a separator.

concatenate two columns in Excel with hyphen


Method 2 – Using CONCATENATE Function and CHAR Function

The products with corresponding delivery conditions with a separator hyphen use the CHAR function with the CONCATENATE function.

concatenate two columns in Excel with hyphen

Steps:
➤ Use the following formula in cell D4

=CONCATENATE(B4,CHAR(45),C4)

B4 is the Product Apple, C4 is the State of Delivery Delivered and CHAR(45) is for the hyphen.

CONCATENATE & CHAR function

➤ Press ENTER and drag down the Fill Handle tool.

CONCATENATE & CHAR function

Result:
You can concatenate the products of the Product column and the delivery states of the State of Delivery column with a hyphen as a separator.

concatenate two columns in Excel with hyphen


Method 3 – Using Ampersand Operator to Concatenate Two Columns in Excel with Hyphen

Steps:
➤ Type the following formula in cell D4.

=B4&"-"&C4

B4 is the Product Apple, C4 is the State of Delivery Delivered, and “-” is the separator between them.

Ampersand operator

➤ Press ENTER and drag down the Fill Handle tool.

Ampersand operator

Result:
Get the concatenation of the products in the Product column, and the delivery states in the State of Delivery column with a hyphen as a separator.

concatenate two columns in Excel with hyphen


Method 4 – Using TEXTJOIN Function to Concatenate Two Columns with Hyphen

Steps:
➤ Type the following formula in cell D4

=TEXTJOIN("-",TRUE,B4,C4)

B4 is the Product Apple, C4 is the State of Delivery Delivered, “-” is the separator between them and TRUE is for ignoring empty cells.

TEXTJOIN function

➤ Press ENTER and drag down the Fill Handle tool.

TEXTJOIN function

Result:
Combine the products in the Product column and the delivery states in the State of Delivery column with a hyphen as a separator.

concatenate two columns in Excel with hyphen


Method 5 – Using Flash Fill Feature to Concatenate Two Columns with Hyphen

The Flash Fill feature of Excel is also helpful in combining the values of two columns.

concatenate two columns in Excel with hyphen

Steps:
➤ Write the combination in the product Apple and the delivery state Delivered with a hyphen between them like below

flash fill feature

➤Start typing the combination for the second row like the previous one.
The suggestions for the remaining rows will appear with the help of the Flash Fill feature, as seen in the following figure.
➤ Press ENTER.

flash fill feature

Result:
You will have the combination of the products in the Product column and the delivery states in the State of Delivery column with a hyphen as a separator.

concatenate two columns in Excel with hyphen


Method 6 – Combining Text String and Numeric Values with Hyphen from Two Columns

Steps:
➤ Use the following formula in cell D4

=CONCATENATE(B4,CHAR(45),TEXT(C4,"$ 0,000.00"))

B4 is the Product Apple, C4 is the Sales value of $1,402.00, CHAR(45) is for hyphen and TEXT will maintain the Accounting format of the sales values.

combining texts and numeric values

➤ Press ENTER and drag down the Fill Handle tool.

combining texts and numeric values

Result:
You can unite the products in the Product column and the sales values in the Sales column with a hyphen as a separator.

combining texts and numeric values


Method 7 – Combining Text String and Date Values with Hyphen from Two Columns

Steps:
➤ Type the following formula in cell D4

=CONCATENATE(B4,"-",TEXT(C4,"m/d/yyyy"))

B4 is the Product Apple, C4 is the Delivery Date of 1/9/2021, “-” is the separator between them and TEXT will maintain the Date format in m/d/yyyy of the delivery dates.

combining texts and date values

➤ Press ENTER and drag down the Fill Handle tool.

combining texts and date values

Result:
Get the concatenation of the products in the Product column and the dates in the Delivery Date column with a hyphen as a separator.

concatenate two columns in Excel with hyphen


Method 8 – Combining the Range of Values of Two Columns

Use the CONCATENATE function and the CHAR function to combine all of the ranges of the two columns, Product and State of Delivery, in a cell.

concatenate two columns in Excel with hyphen

Steps:
➤ Enable the Wrap Text option for the cell where we will have the combination by selecting that cell and then going through Home Tab >> Wrap Text Option.

combining range of values of two columns

➤ Write the following formula in the selected cell

=CONCATENATE(B4,"-",C4,CHAR(10),B5,"-",C5,CHAR(10),B6,"-",C6,CHAR(10),B7,"-",C7,CHAR(10),B8,"-",C8,CHAR(10),B9,"-",C9)

B4, B5, B6, B7, B8, B9 are the products of the Product column, C4, C5, C6, C7, C8, C9 are the delivery conditions of the State of Delivery column, “-” is the separator between them and CHAR(10) will create a line break between each combination of Product and State of Delivery.

combining range of values of two columns

After pressing ENTER, you have to drag down the plus symbol below Row 12 to increase the height of this row to fit all of the combinations.

combining range of values of two columns

Result:
See all of the combinations of the two columns in Row 12.

concatenate two columns in Excel with hyphen


Method 9 – Using VBA Code to Concatenate Two Columns in Excel with Hyphen

Steps:
➤ Go to Developer Tab >> Visual Basic Option.

VBA Code

The Visual Basic Editor will open up.
➤ Go to Insert Tab >> Module Option.

VBA Code

A Module will be created.

concatenate two columns in Excel with hyphen

➤ Write the following code

Function combinecolumn(x As String, y As String) As Variant

combinecolumn = x + "-" + y

End Function

It will create a function named combinecolumn and here x is for the string of the Product column, y is for the string of the State of Delivery column.

Then x, “-” and y will be combined with the “+” operator.

VBA Code

Go back to the sheet and write the following formula in cell D4

=combinecolumn(B4,C4)

B4 is the Product Apple, C4 is the State of Delivery Delivered, and the combined column will combine them with a hyphen as a separator.

VBA Code

➤ Press ENTER and drag down the Fill Handle tool.

VBA Code

Result:
We have concatenated the products in the Product column and the delivery status in the State of Delivery column with a hyphen as a separator.

concatenate two columns in Excel with hyphen


Download Workbook


<< Go Back to Range | Concatenate | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Tanjima Hossain
Tanjima Hossain

TANJIMA HOSSAIN is a marine engineer who enjoys working with Excel and VBA programming. For her, programming is a handy, time-saving tool for managing data, files, and online tasks. She's skilled in Rhino3D, Maxsurf C++, MS Office, AutoCAD, and Excel & VBA, going beyond the basics. She holds a B.Sc. in Naval Architecture & Marine Engineering from BUET and is now a content developer. In this role, she creates tech-focused content centred around Excel and VBA. Apart from... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo