Adding strings in Excel means combining text from different cells into one single cell. The most common and reliable method is using the ampersand (&) symbol, which is faster and works in every version of the software. Alternatively, you can use the CONCAT or TEXTJOIN functions, depending on your specific needs for separating data or handling multiple ranges. Both methods require that your data is entered into cells before you begin the formula process.
What You'll Need
- A computer with Microsoft Excel installed (Excel 2016, 2019, 2021, or Microsoft 365 are all supported).
- A worksheet containing at least two cells with text data that you wish to combine.
- A basic understanding of how to select cells and type formulas into the formula bar.
Step-by-Step
- Select the cell where you want the combined string to appear. Click on any empty cell in your worksheet. This is where the result of your formula will be displayed. If you have a list of names and addresses, for example, you would select the first cell under a header like "Full Address" to populate the first entry.
- Start typing the formula with an equals sign. Type "=" into the selected cell. This signals to Excel that you are about to enter a formula rather than just plain text. The cell cursor will move to the formula bar at the top of the screen, and the cell itself will display the "=" sign.
- Input the first text value or cell reference. You can type the text directly (enclosed in double quotation marks, e.g., "Hello ") or click on the cell containing the first piece of text. If you click the cell, Excel will automatically add the cell reference (e.g., A2). Ensure there is a space after the first text if you want a space between the words later.
- Add the ampersand (&) symbol. Type the ampersand key (located above the Enter key on most keyboards). This is the operator that tells Excel to join the data together. You must use this symbol between each piece of text or cell reference.
- Input the second text value or cell reference. Repeat step 3 for the second piece of data you want to combine. If you are combining names, this would be the last name. Again, you can type it directly or click the cell containing it.
- Press Enter to complete the formula. Once you have entered the last piece of data, press the Enter key on your keyboard. Excel will calculate the result and display the combined string in the cell. If you typed "Hello " followed by the ampersand and the cell reference A2, the result will be "Hello John Doe".
Using the CONCAT Function
For users on newer versions of Excel (Excel 2016 and later), the CONCAT function provides a cleaner syntax that does not require the ampersand. To use this method, follow these steps:
- Select the cell where you want the result to appear.
- Start typing the formula:
=CONCAT(. - Click on the first cell containing the text you want to combine. Alternatively, type the cell reference (e.g., A2).
- Type a comma
,to separate the arguments. - Click on the second cell containing the text you want to combine.
- Close the parenthesis
). - Press Enter.
Using the TEXTJOIN Function
The TEXTJOIN function is the most powerful tool for adding strings when you need to separate them with a specific character, such as a comma, line break, or space. This function also allows you to combine text from non-adjacent cells or entire columns at once. The syntax is =TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...).
- Select the cell where you want the result to appear.
- Type
=TEXTJOIN(to begin the formula. - Enter the separator. This is the character that will appear between the combined text. You can type a comma
,for a list, or double quotes with a space" "for a visual gap. For a line break, typeCHAR(10)inside the quotes. - Enter the ignore empty argument. Type
TRUEif you want Excel to skip any empty cells in your range. TypeFALSEif you want empty cells to display as separators (e.g., a comma where no data exists). - Enter the range or cells. Click and drag to select the range of cells you want to combine (e.g., A2:A10). You can also click on individual cells separated by commas (e.g., A2, B2, C2).
- Close the parenthesis
). - Press Enter.
Common Mistakes
- Forgetting the ampersand (&) when using the manual method. A very common error is typing the cell references one after another without the ampersand. Excel will interpret this as trying to multiply the values or will display an error if the cells contain text. Always ensure the ampersand is present between each item.
- Missing quotation marks around text strings. If you are typing a specific word, number, or phrase directly into the formula (not referencing a cell), you must enclose it in double quotation marks. For example,
=A1 & "-" & B1is correct, but=A1 & - & B1will result in an error because the hyphen is not treated as text. - Not accounting for data types. Excel sometimes struggles to combine a number with text automatically. If you have a number in cell A1 and text in B1, the result will usually be text, but if you try to combine text in A1 and a number in B1, you may get a
#VALUE!error. The TEXTJOIN function handles this conversion more gracefully than the simple ampersand method.
Tips
- Use the F4 key to lock cells. If you are dragging the formula down a column, you might want to keep the separator text constant while changing the cell references. If you are using the ampersand method and want to keep the separator text (e.g., a hyphen) in the middle, type the separator first, press F4 to lock it (it will appear as $ sign), and then add the cell references on either side.
- Format the result as text. If you are combining numbers and the result looks like a number (e.g., 123456) instead of a string (e.g., 123-456), you can force the cell to be text by typing an apostrophe (') before the number in a separate cell, or by using the TEXT function to format the number before joining it.
- Use CHAR(10) for line breaks. If you are combining addresses or paragraphs and want them to appear on separate lines within the same cell, use
CHAR(10)as the separator in the TEXTJOIN function. You will also need to enable "Wrap Text" in the cell's format settings to see the line break.
Troubleshooting
Result shows the formula instead of the text
If you see a long string of text starting with an equals sign (=A2&B2) in the cell instead of the combined data, it means the cell is formatted as text. Excel does not automatically calculate text inside a text-formatted cell. To fix this, right-click the cell, select "Format Cells," choose "General," and then press F9 to recalculate the sheet.
#VALUE! Error appears
The #VALUE! error occurs when Excel attempts to perform mathematical operations on text, or when a text argument is missing. Check to ensure that all cell references you are using actually contain text data. If you are trying to join a number and text, consider using the TEXT function to convert the number to a text string first.
Combined string is missing spaces or punctuation
When using the ampersand method, Excel does not add extra spaces automatically. You must type a space character inside the quotation marks yourself (e.g., "Hello " & A2). If using TEXTJOIN, ensure the separator argument explicitly includes a space character inside the quotation marks.
Text is cut off or hidden
If the combined text looks truncated (e.g., you only see the first few letters), the cell width is likely too narrow. Double-click the column border to auto-fit the width, or manually drag the edge of the column header to make it wider. Additionally, if the text is longer than the cell height, you must enable "Wrap Text" from the Home tab to display it correctly.
Frequently Asked Questions
Can I add strings from non-adjacent cells?
Yes, you can. When using the ampersand method or the TEXTJOIN function, you can simply type the cell references separated by commas. For example, =A2 & B2 & D2 will combine the data from A2, B2, and D2 in that specific order.
How do I add a line break between strings?
Use the CHAR(10) function as the separator in your formula. For example, =TEXTJOIN(CHAR(10), TRUE, A2:A10) will combine the text in cells A2 through A10, placing each item on a new line within the same cell. Remember to apply the "Wrap Text" formatting to the cell to see the lines.
What is the difference between CONCAT and TEXTJOIN?
CONCAT is a simpler function that only joins text. It does not allow you to specify a delimiter (like a comma or space) between the items. TEXTJOIN is more advanced because it allows you to specify a separator and choose whether to ignore empty cells, making it much better for creating lists or formatted strings.
Why does my formula return a number instead of text?
If you combine a number with text using the ampersand, Excel usually converts the result to text. However, if the number is very large (such as a credit card number or a long ID), Excel might truncate it or convert it to scientific notation. To prevent this, you can convert the number to text by adding an apostrophe before the number (e.g., ='1234567890123456) or by using the TEXT function.
Can I combine strings from different sheets?
Yes. You can reference cells on other sheets by typing the sheet name followed by an exclamation mark. For example, =Sheet1!A2 & " " & Sheet2!B2 will combine the value in A2 of Sheet1 with the value in B2 of Sheet2.
Does the order of cells matter?
Yes, the order in which you place the cell references or text strings in the formula determines the order of the final result. You must type them exactly as you want them to appear in the final combined string.
How do I add a date to a string?
Dates in Excel are actually stored as serial numbers, so they will not combine correctly with text strings using the ampersand method without formatting. The best way to combine a date with text is to use the TEXT function to format the date as a string first. For example, ="The date is " & TEXT(A2, "mm/dd/yyyy").
Can I add strings to a specific position inside existing text?
Standard string concatenation functions like CONCAT and TEXTJOIN place the joined text at the end of the original text or between the specified arguments. To insert text inside the middle of an existing string, you must use the SEARCH function to find the position of the text and the REPLACE function to insert the new text at that location.
Is there a limit to how many strings I can combine?
There is a limit to the length of a formula in Excel, which is 8,192 characters. If you try to combine a very large amount of text, you may exceed this limit. If you need to combine massive amounts of data, it is often better to use Power Query or a VBA script rather than a simple formula.
How do I combine strings from a whole column?
The TEXTJOIN function is ideal for this. You can select the entire column (e.g., A:A) as the argument for the range. This will combine every text string in that column, separated by your chosen delimiter, into the single cell where you entered the formula.
Can I use the CONCAT function in Excel 2010?
No, the CONCAT function was introduced in Excel 2016. Users on older versions (Excel 2010, 2013, and 2015) must use the CONCATENATE function or the ampersand (&) method. The syntax is the same, but the function name is different.
What happens if I have an empty cell in the range?
If you use the ampersand method and have an empty cell, the formula will simply skip it and combine the remaining text, potentially leaving no space between words. If you use TEXTJOIN and set the ignore_empty argument to TRUE, it will completely skip the empty cell. If you set it to FALSE, it will insert the separator (like a comma) even if the cell is empty.
Can I add strings from a PivotTable?
You can reference cells within a PivotTable, but the data might change as the PivotTable refreshes. It is generally better to pull the data you need into a standard table first and then use that table for your string concatenation to ensure consistency.
How do I combine strings with special characters?
If you are trying to combine strings that contain special characters like ampersands, quotes, or asterisks, you must be careful with quotation marks. If the special character is not part of the formula syntax, you can include it in the text string. If it is part of the syntax, you might need to escape it or use different quotes to enclose the text.
Can I add strings from a list of names and titles?
Yes. You can use the ampersand method to create a "Title, First Name Last Name" format. For example, =B2 & ", " & A2 & " " & C2. This would take the value in B2 (Title), add a comma and space, then add the value in A2 (First Name), a space, and finally the value in C2 (Last Name).
How do I add a string to the beginning of an existing cell?
You can use the ampersand method to prepend text to an existing value. For example, if you want to add the word "Email:" to the beginning of the email address in cell A1, you would type ="Email: " & A1. This will take the text "Email: " and append the value of A1 to the end.
Can I add strings from a range of cells that includes numbers?
Yes, but the numbers will be treated as text. If you have a range of cells that includes both text and numbers, and you use the ampersand method or the CONCAT function, Excel will convert the numbers to text strings. This is useful if you want to ensure that leading zeros in numbers are preserved, as they would be lost if the number were treated as a numeric value.
How do I combine strings with a specific delimiter like a hyphen?
Simply type the hyphen inside the quotation marks as the separator. For example, =TEXTJOIN("-", TRUE, A2:A10) will combine the text in cells A2 through A10, placing a hyphen between each item. This is commonly used for creating phone numbers or product codes.
Can I use this method to combine strings from a table?
Yes, you can reference the table headers. For example, if you have a table named "SalesData" and you want to combine the "FirstName" and "LastName" columns, you can type =CONCAT(SalesData[FirstName], " ", SalesData[LastName]). This allows you to easily combine data from structured tables.
What is the difference between concatenating and appending?
In the context of Excel, concatenating and appending are often used interchangeably to mean joining two strings together. However, appending specifically refers to adding a string to the end of another string. The ampersand method allows you to append text to existing text, but it also allows you to insert text in the middle of an existing string.
Can I add strings from a text box?
No, the concatenation functions only work with cells. If you have text in a text box, shape, or SmartArt, you cannot directly reference it in a formula. You would need to extract the text from the shape and place it into a cell first, and then use that cell in your formula.
How do I combine strings with a comma and space?
Type a comma followed by a space inside the quotation marks. For example, =TEXTJOIN(", ", TRUE, A2:A10). This will create a standard comma-separated list where each item is followed by a space. This is the most common format for creating lists or separating items.
Can I add strings from a range that is not adjacent?
Yes, you can select non-adjacent ranges by holding down the Ctrl key while selecting the cells. For example, =CONCAT(A2, B2, D2, F2) will combine the text from A2, B2, D2, and F2. This is useful if you have data scattered across the sheet but want to combine it into a single cell.
How do I add strings with a line break and a comma?
You can nest the functions. For example, =TEXTJOIN(CHAR(10) & ", ", TRUE, A2:A10). This will place a comma and a space after each line break. This is useful for creating a list where each item is on a new line and separated by a comma.
Can I add strings from a range that includes errors?
If a cell in the range contains an error (like #N/A or #VALUE!), the CONCAT function will return the error. The TEXTJOIN function will also return the error, unless you use the IFERROR function to handle it. For example, =TEXTJOIN(", ", TRUE, IFERROR(A2:A10, "")) will replace any errors with an empty string.