Concatenation in Excel means joining two or more text strings into a single cell. It is done using the ampersand symbol (&) or the CONCAT and TEXTJOIN functions. This is useful for combining first and last names, merging address lines, or creating unique IDs from separate data points.
What You'll Need
- A computer with Microsoft Excel installed (Excel 2010 or later is recommended for full function support).
- A spreadsheet containing data you wish to combine, such as a list of names or addresses.
- A basic understanding of cell references (e.g., A1, B2).
Step-by-Step
- Open your workbook. Launch Excel and open the document containing the data you want to combine.
- Locate your data. Identify the cells that contain the separate pieces of information. For example, if you have a first name in cell A1 and a last name in cell B1, these are your source cells.
- Click the target cell. Click on the empty cell where you want the combined text to appear. This could be in a new column or an existing one.
- Start the formula. Type an equals sign (=) to begin a new formula.
- Enter the first cell. Click on the first cell containing the text you want to include. For a first name, this would be cell A1. The formula now looks like: =A1
- Insert the ampersand. Type the ampersand symbol (&) directly after the cell reference. Do not type a space before or after it. The formula is now: =A1&
- Enter the separator. Type the text or symbol that will sit between the two pieces of information. This can be a space, a comma, a hyphen, or any other character you prefer. For a full name, you would type a space. The formula is now: =A1&
- Enter the next cell. Click on the next cell containing the text you want to add. For a last name, this would be cell B1. The formula is now: =A1& B1
- Complete the formula. Press Enter on your keyboard. The target cell will now display the combined text, such as "John Doe".
- Drag to apply to other rows. To combine names for the rest of your list, click on the small square handle in the bottom-right corner of the target cell. Drag it down to apply the formula to the other rows. Excel will automatically adjust the cell references for each row.
Using the CONCAT Function (Excel 2016 and later)
- Click the target cell. Select the cell where you want the result to appear.
- Start the formula. Type =CONCAT(
- Select the first cell. Click on the first cell containing text. You can also type its reference, like A1.
- Separate with commas. Type a comma (,) to separate each cell reference. Continue clicking on the next cells you wish to include in the concatenation. For example: =CONCAT(A1, B1)
- Close the parentheses. Type ) and press Enter.
- Apply to other rows. Drag the fill handle down to apply the formula to the rest of your data.
Using the TEXTJOIN Function (Excel 2019 and Office 365)
- Click the target cell. Select the cell where you want the result to appear.
- Start the formula. Type =TEXTJOIN(
- Enter the separator. Type the character you want to use to separate the text (e.g., a space, comma, hyphen) inside double quotes. For a space, type " ". Close the double quotes. The formula now looks like: =TEXTJOIN(" ",
- Enter the delimiter argument. Type TRUE (for TRUE: ignore empty cells) or FALSE (for FALSE: include empty cells). Press the comma key again.
- Select the range. Click and drag to select the range of cells you want to combine. The formula is now: =TEXTJOIN(" ", TRUE, A1:A10)
- Close the parentheses. Type ) and press Enter.
- Apply to other rows. Drag the fill handle down to apply the formula to the rest of your data.
Common Mistakes
- Forgetting the ampersand. A common error is typing the cell references with a space between them, like A1 B1. This will result in a #VALUE! error. You must use the ampersand (&) to tell Excel you want to concatenate the values.
- Incorrect spacing. When using the ampersand method, it is easy to accidentally add a space after the ampersand and before the next cell reference, resulting in a double space in the final output. Ensure there are no spaces around the ampersand.
- Not closing parentheses. When using the CONCAT or TEXTJOIN functions, forgetting to close the parentheses will result in a formula error. Double-check that every opening parenthesis has a corresponding closing one.
- Wrong cell references. When dragging the fill handle to apply the formula to other rows, it is important that the formula is set up to use relative references (e.g., A1, B1). If you use absolute references (e.g., $A$1, $B$1), the formula will not update correctly for other rows.
Tips
- Use quotes for literal text. If you want to add a fixed string of text to your concatenated result, enclose it in double quotes. For example: =A1&" - Customer" will add " - Customer" to the end of the text in cell A1.
- Combine with other functions. You can nest other functions inside a concatenation formula. For example, to combine a first name and last name and convert the result to uppercase, you could use: =UPPER(A1&B1). This is useful for creating standardized usernames or IDs.
- TEXTJOIN is more efficient. For combining a large number of cells, the TEXTJOIN function is often more efficient and easier to use than the ampersand method or the CONCAT function. It also has built-in options to ignore empty cells.
Troubleshooting
- Formula returns #VALUE! error. This error typically occurs when one of the cells being referenced contains non-text data, such as a number or a date. To fix this, you can wrap the cell reference in the TEXT function to convert it to text. For example, instead of referencing cell A1 directly, you would use: =TEXT(A1, "@")&B1. The "@" format code tells Excel to format the number as text.
- Formula returns a #NAME? error. This error usually happens if you are using the CONCAT or TEXTJOIN functions in an older version of Excel (Excel 2013 or earlier). These functions were introduced in Excel 2016 and Excel 2019, respectively. You should switch to using the ampersand (&) method for these older versions.
- Spaces are missing or doubled. Double-check the formula for spaces around the ampersand symbol. Ensure you are using a single space character (" ") between the two parts of the text if that is what you want.
- Dragging the fill handle doesn't work. If dragging the fill handle down does not copy the formula to the other rows, check that you are using relative cell references (A1, not $A$1). Also, make sure the "AutoFill Options" button (which appears after you drag) is set to "Fill Down".
Frequently Asked Questions
What is the difference between CONCAT and TEXTJOIN?
CONCAT combines text from multiple cells without the ability to easily specify a delimiter (like a comma or space). TEXTJOIN allows you to specify a delimiter and has an option to ignore empty cells, making it more flexible for complex data cleaning tasks.
How do I concatenate a number with text?
By default, Excel will treat a number as a value and not concatenate it with text. To combine them, you must convert the number to text. You can do this by adding a single quote (') before the number in the cell, or by using the TEXT function in your formula, such as =TEXT(A1, "0")&" apples".
Can I concatenate more than two cells?
Yes, you can concatenate any number of cells using the ampersand method by chaining them together. For example, =A1&B1&C1&D1 will combine four cells. The CONCAT and TEXTJOIN functions also accept multiple arguments.
Why does my concatenated result look like a number?
If the concatenated result looks like a number (e.g., 12345 instead of "12345"), it is likely because one of the source cells is a number and Excel is interpreting the entire result as a number. To fix this, ensure that at least one of the source cells is text, or format the result cell as Text before entering the formula.
How do I add a line break to a concatenated string?
You can add a line break by using the CHAR(10) function inside your concatenation formula. For example, =A1&CHAR(10)&B1 will put the content of A1 on one line and the content of B1 on the next line. You will also need to wrap the target cell in the TEXT function with the wrap text setting enabled (e.g., =TEXT(A1&CHAR(10)&B1, "@").)