The CONCAT
function in Excel is a powerful tool used to join or concatenate multiple text strings into one. This function is particularly useful for combining data from different cells into a single cell, making it easier to manage and analyze data.
Syntax
Function | Description |
---|---|
CONCAT(text1, [text2], ...) | Joins multiple text strings into one. text1 , text2 , etc., are the text items to be joined. |
Example
Let's consider a more complex example where we have a table with the following data:
We want to create a new column that combines the First Name, Last Name, Department, and Extension into a single string in the format: First Name Last Name (Department): Extension
.
Using the CONCAT
function, the formula would look like this:
=CONCAT(A2, " ", B2, " (", C2, "): ", D2)
Exercises
Exercise 1
Task: Combine the Product Name and Category into a single column in the format: Product Name - Category
.
Exercise 2
Task: Create a full address by combining Street, City, and ZIP Code into one cell in the format: Street, City, ZIP Code
.
Solutions
Exercise 1 Solution:
To combine the Product Name and Category into a single column:
=CONCAT(A2, " - ", B2)
For each row, the combined results will be:
Product Name | Category | Combined Result |
---|---|---|
Laptop | Electronics | Laptop - Electronics |
Desk | Furniture | Desk - Furniture |
Pen | Stationery | Pen - Stationery |
Monitor | Electronics | Monitor - Electronics |
Exercise 2 Solution:
To create a full address by combining Street, City, and ZIP Code:
=CONCAT(A2, ", ", B2, ", ", C2)
For each row, the combined results will be:
Street | City | ZIP Code | Combined Result |
---|---|---|---|
123 Elm St | Springfield | 62704 | 123 Elm St, Springfield, 62704 |
456 Oak Ave | Shelbyville | 61563 | 456 Oak Ave, Shelbyville, 61563 |
789 Pine Blvd | Capital City | 62712 | 789 Pine Blvd, Capital City, 62712 |
101 Maple Drive | Ogdenville | 61001 | 101 Maple Drive, Ogdenville, 61001 |