Yes, you can combine two columns in Excel using a simple formula or the Flash Fill feature, which instantly recognizes the pattern and fills the new column with the merged data.
What You'll Need
- A computer with Microsoft Excel installed (desktop version for full functionality, though the web version supports most of these methods).
- Two columns of data you wish to merge (for example, a First Name column in column A and a Last Name column in column B).
- A third empty column where the combined data will appear (this is usually column C).
Step-by-Step
Method 1: The Concatenate Function
This is the classic, reliable method for combining text. It is flexible because it allows you to add specific characters, like spaces, commas, or symbols, between the data points.
- Select the first cell in the empty column where you want the combined text to appear. Ideally, this is the cell directly below or next to your first set of data.
- Type the equals sign (=) to start a formula. Do not press Enter yet.
- Enter the function name followed by an opening parenthesis. Type
CONCATENATEor simplyCONCAT. Both functions work identically in modern Excel versions, butCONCATis the newer, shorter name. - Select the first cell from your first column. In this example, click on cell A2 to select the first name.
- Enter a separator. If you want a space between the names, type a space character inside the parentheses. It should look like
" ". If you want a comma, type", ". - Select the second cell from your second column. Click on cell B2 to select the last name.
- Close the parenthesis and press Enter. The formula should look something like this:
=CONCATENATE(A2, " ", B2)or=CONCAT(A2, " ", B2). - Copy the formula. Click and drag the small square fill handle (the dot in the bottom-right corner of the cell) down to the bottom of your data set to apply the formula to all rows.
Method 2: The Ampersand (&) Operator
Many users prefer this method because it is shorter to type and easier to read. It works exactly the same way as the Concatenate function but uses symbols instead of function names.
- Click the first cell in your empty output column.
- Type the equals sign (=).
- Type the reference of the first cell (e.g.,
A2). - Type an ampersand (
&). This is the operator that tells Excel to join the items together. - Type your separator (e.g., a space
" "). - Type the reference of the second cell (e.g.,
B2). - Press Enter. The result will appear instantly.
- Drag the fill handle down to apply the formula to the rest of your list.
Method 3: Flash Fill (The Easiest Way)
Flash Fill is a powerful feature that does not require writing formulas. It analyzes the data you type and predicts the rest of the column based on the pattern.
- Look at your data. In column A you have names, and in column B you have surnames.
- Type the desired result manually in the first cell of your new column (e.g., cell C2). Type the full name with a space between them:
John Doe. - Look at the next cell (C3). Excel will usually automatically fill it in with the next name in the list based on the pattern it recognized.
- If it does not fill automatically, press Ctrl + E on Windows or Cmd + E on Mac. This command forces Excel to execute the Flash Fill operation.
- Excel will instantly populate the entire column with the combined names.
Method 4: Combining with Line Breaks
Sometimes you want to combine text but keep it on separate lines within the same cell, which is useful for creating mailing labels or formatted reports.
- Click the cell where you want the combined text.
- Start the formula using the ampersand method:
=A2 & " " & B2. - Insert a line break by typing
"#CHAR(10)#". In modern Excel, this is best done by typingCHAR(10)directly into the formula. - Complete the formula:
=A2 & CHAR(10) & B2. - Press Enter.
- Format the cell to wrap text. Right-click the cell, select Format Cells, go to the Alignment tab, and check the box for Wrap text.
Common Mistakes
Leaving Out Separators
A common error is typing =CONCATENATE(A2, B2) without any characters in between. This results in the data being stuck together with no space, producing a string like JohnDoe instead of John Doe. Always remember to type the space character inside the quotation marks.
Mixing Data Types
If you try to combine numbers and text, Excel will convert the numbers to text. For example, combining a number (10) and text (" apples") will result in the text string "10 apples". This is usually fine, but be aware that the cell is now text and cannot be used in mathematical calculations.
Ignoring Column Headers
When dragging the fill handle, be careful not to overwrite your column headers. Always drag the handle down to the last row of data, not the row containing the header text.
Tips
Use Flash Fill for Speed
If you are working with a small dataset, Flash Fill is often faster than writing a formula. It requires no knowledge of syntax and is virtually error-proof.
Order Matters
When using the ampersand operator, the order of the cells determines the final string. =A2 & B2 puts the first column first. =B2 & A2 swaps them. This is useful if you need to reverse the order of your data.
Handling Special Characters
If you are combining text that contains quotes, you must use double quotes for the separator and single quotes for the text, or escape the quotes. For example, to combine a name with a quotation mark: =A2 & " says: " & B2.
Troubleshooting
The Result Shows "#VALUE!"
This error usually means one of the cells you are trying to combine contains a non-text value, such as an error code or a date formatted as a number. Check the source cells to ensure they contain clean text data.
The Result Shows "#NAME?"
This error occurs if you misspelled the function name. Ensure you typed either CONCATENATE or CONCAT correctly.
The Data is Not Formatting Correctly
If you used the line break method (CHAR(10)) but the text is still on one line, the cell is not set to wrap text. Right-click the cell and select Format Cells > Alignment > Wrap Text.
Flash Fill Is Not Working
Flash Fill relies on patterns. If your data is inconsistent (for example, some names are first-last and others are last, first), Flash Fill may struggle to identify the correct pattern. In these cases, writing a specific formula is more reliable.
Frequently Asked Questions
Can I combine more than two columns?
Yes. You can chain together multiple cells using the ampersand operator. For example, =A2 & " " & B2 & " " & C2 will combine three columns into one.
How do I add a comma between the columns?
Simply type a comma and a space inside the quotation marks of your formula. For example, =CONCATENATE(A2, ", ", B2).
Does combining columns change the original data?
No. The formulas create a new value in the output cell. The original data in columns A and B remains untouched.
Why does my combined text look all squashed together?
This is usually because the separator was missed. Double-check your formula to ensure you included a space character or a comma between the two cell references.
Can I use Flash Fill on the web version of Excel?
Yes, the web version of Excel supports Flash Fill, but the keyboard shortcut is slightly different. On Windows, you usually need to click the Fill button in the Data tab and select Flash Fill. On Mac, the shortcut may not work in all browsers, so clicking the button is the safest approach.
What if I want to delete the original columns?
Once you have your combined data, you can safely delete the original columns. The combined data will remain in the new column. If you want to replace the original data with the combined data, you can click the cell, press Ctrl + C to copy, select the original column, and press Ctrl + V to paste.